arnaucube
arnaucube/cryptofunPublic Self-hosted repository
cryptofun/README.md
README.mdRaw
 1# cryptofun [![Go Report Card](https://goreportcard.com/badge/github.com/arnaucube/cryptofun)](https://goreportcard.com/report/github.com/arnaucube/cryptofun)
 2
 3Crypto algorithms from scratch. Academic purposes only.
 4
 5
 6## RSA
 7https://en.wikipedia.org/wiki/RSA_(cryptosystem)#
 8- [x] GenerateKeyPair
 9- [x] Encrypt
10- [x] Decrypt
11- [x] Blind
12- [x] Blind Signature
13- [x] Unblind Signature
14- [x] Verify Signature
15- [x] Homomorphic Multiplication
16
17## Paillier
18https://en.wikipedia.org/wiki/Paillier_cryptosystem
19- [x] GenerateKeyPair
20- [x] Encrypt
21- [x] Decrypt
22- [x] Homomorphic Addition
23
24## Shamir Secret Sharing
25https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing
26- [x] create secret sharing from number of secrets needed, number of shares, random point p, secret to share
27- [x] Lagrange Interpolation to restore the secret from the shares
28
29## Diffie-Hellman
30https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange
31- [x] key exchange
32
33## ECC
34https://en.wikipedia.org/wiki/Elliptic-curve_cryptography
35- [x] define elliptic curve
36- [x] get point at X
37- [x] get order of a Point on the elliptic curve
38- [x] Add two points on the elliptic curve
39- [x] Multiply a point n times on the elliptic curve
40
41## ECC ElGamal
42https://en.wikipedia.org/wiki/ElGamal_encryption
43- [x] ECC ElGamal key generation
44- [x] ECC ElGamal Encrypton
45- [x] ECC ElGamal Decryption
46
47## ECC ECDSA
48https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm
49- [x] define ECDSA data structure
50- [x] ECDSA Sign
51- [x] ECDSA Verify signature
52
53
54## Schnorr signature
55https://en.wikipedia.org/wiki/Schnorr_signature
56- [x] Hash[M || R] (where M is the msg bytes and R is a Point on the ECC, using sha256 hash function)
57- [x] Generate Schnorr scheme
58- [x] Sign
59- [x] Verify signature
60
61
62## Bn128
63**[not finished]**
64
65This is implemented followng the implementations and info from:
66- https://github.com/iden3/zksnark
67- https://github.com/zcash/zcash/tree/master/src/snark
68- `Multiplication and Squaring on Pairing-Friendly
69Fields`, Augusto Jun Devegili, Colm Ó hÉigeartaigh, Michael Scott, and Ricardo Dahab https://pdfs.semanticscholar.org/3e01/de88d7428076b2547b60072088507d881bf1.pdf
70- `Optimal Pairings`, Frederik Vercauteren https://www.cosic.esat.kuleuven.be/bcrypt/optimal.pdf
71
72- [x] Fq, Fq2, Fq6, Fq12 operations
73
74---
75
76To run all tests:
77```
78go test ./... -v
79```