Skip to content

Latest commit

 

History

History
95 lines (58 loc) · 2.96 KB

NOTES.md

File metadata and controls

95 lines (58 loc) · 2.96 KB

Notes

OpenSSL (binding/wrapper) in ruby

Tips & Tricks

big number (bn)

  • opensll adds Integer#to_bn for easy conversion
999.to_bn    # same as   OpenSSL::BN.new( 999 )
-999.to_bn
2**107-1).to_bn
(-(2**107-1)).to_bn

Source: https://github.com/ruby/openssl/blob/master/test/openssl/test_bn.rb

use to_bn to construct Point too? why? why not?

assert_equal 0x040603.to_bn, point.to_bn
assert_equal 0x040603.to_bn, point.to_bn(:uncompressed)
assert_equal 0x0306.to_bn,   point.to_bn(:compressed)

Source: https://github.com/ruby/openssl/blob/master/test/openssl/test_pkey_ec.rb

More Elliptic Libraries

ruby

python

More Elliptic Articles

A (relatively easy to understand) primer on elliptic curve cryptography Everything you wanted to know about the next generation of public key crypto by Nick Sullivan, October 2013 - https://arstechnica.com/information-technology/2013/10/a-relatively-easy-to-understand-primer-on-elliptic-curve-cryptography/

Elliptic Curve Cryptography: a gentle introduction by Andrea Corbellini, May 2015 - https://andrea.corbellini.name/2015/05/17/elliptic-curve-cryptography-a-gentle-introduction/

What is the math behind elliptic curve cryptography? by Hans Knutson, April 2018 - https://hackernoon.com/what-is-the-math-behind-elliptic-curve-cryptography-f61b25253da3

Elliptic Curve @ Wolfram Math World - https://mathworld.wolfram.com/EllipticCurve.html

Practical Cryptography for Developers by Svetlin Nakov:

sources: https://github.com/nakov/practical-cryptography-for-developers-book

Wikipedia:

More Articles

A Layman's Guide to a Subset of ASN.1, BER, and DER by Burton S. Kaliski Jr., An RSA Laboratories Technical Note, Revised November, 1993 - http://luca.ntop.org/Teaching/Appunti/asn1.html

  • ASN.1 = Abstract Syntax Notation One
  • BER = Basic Encoding Rules (for ASN.1)
  • DER = Distinguished Encoding Rules (for ASN.1) - note: (strict/deterministic) subset of BER