# Basic

https://www.tokenscript.org/t/demo-tool-for-express-of-trust/235

Weierstrass equation

https://en.wikipedia.org/wiki/Elliptic_curve

ecc commutative associative

https://pdfs.semanticscholar.org/ab40/c9d62b65a27179eab8e0f0f654170c2540bd.pdf

A set G is called an abelian group (G, ) with a binary operation : GG --> G if it satisfies the following properties:

• Associativity: (ab)c=a(bc) for all a,b,c ∈G .
• Commutativity: ab=ba for all a,b, ∈G .
• Identity: there exists i∈G such that ai = ia=a for all a ∈G .
• Inverse: for each a∈G , there exists b∈G such that ab=ba=i . Element b is called the inverse of a.

The group is called additive or multiplicative if the binary operation is called addition (+) or multiplication (*), respectively. For the first case, the identity element is usually denoted by 0, and the additive inverse of an element a, by –a. For the second case, the identity element is usually denoted by 1, and the multiplicative inverse of an element a, by a^-1 .

# RSA到ECC椭圆算法

A (relatively easy to understand) primer on elliptic curve cryptography https://arstechnica.com/information-technology/2013/10/a-relatively-easy-to-understand-primer-on-elliptic-curve-cryptography/ 一个关于椭圆曲线密码学的初级读本（相当容易懂) 8btc.com/thread-1240-1-1.html 跨越千年的RSA算法 www.matrix67.com/blog/archives/5100 RSA加密学习的简单例子 https://blog.csdn.net/dianqu6970/article/details/76527572 RSA算法演绎 www.voidcn.com/article/p-kwtzevgb-bpo.html ECC加密算法入门介绍 https://www.pediy.com/kssd/pediy06/pediy6014.htm Martijn Grooten - Elliptic Curve Cryptography for those who are afraid of maths https://www.youtube.com/watch?v=yBr3Q6xiTw4 Elliptic Curve Cryptography Tutorial - Understanding ECC through the Diffie-Hellman Key Exchange https://www.youtube.com/watch?v=gAtBM06xwaw

# ETH

Hash function Keccak? Keccak-256? Sha3? To make it clearer that Ethereum uses KECCAK-256 instead of the NIST standardized SHA-3 hash function, Solidity 0.4.3 has introduced keccak256. (It is an alias to sha3, meaning that keccak256 produces identical results to sha3, but with the intent to avoid confusion, especially for developers new to Ethereum.) It's recommended that new code use keccak256 instead of sha3 Rename/alias sha3 to minimize confusion with SHA-3 standard https://github.com/ethereum/EIPs/issues/59

HASH160

# Use Case

# sign xml using Eth private key

Eckeypair => x509 crt => sign xml with xmlsectool

Issue:

1. Private key string to eckeypair
2. Eckeypair to java keypair BCECPrivateKey
3. Generate x509 crt programmatically
4. Add xmlsectool jar to sign with crt

https://www.programcreek.com/java-api-examples/?code=papyrusglobal/state-channels/state-channels-master/channel-node/src/main/java/papyrus/channel/node/server/NodeServer.java#

PKCS12 PKCS8?

X509V1CertificateGenerator "bc" bouncyCastleProvider

https://github.com/web3j/web3j/blob/master/crypto/src/main/java/org/web3j/crypto/ECKeyPair.java

Java KeyPair => ECKeyPair public static ECKeyPair create(KeyPair keyPair) {

How to use .key and .crt file in java that generated by openssl? https://stackoverflow.com/questions/6482484/how-to-use-key-and-crt-file-in-java-that-generated-by-openssl

Refer: Creating X.509 certificates programmatically in Java https://www.mayrhofer.eu.org/create-x509-certs-in-java