|
1 | 1 | ed25519-java |
2 | 2 | ============ |
3 | 3 |
|
| 4 | +This is a fork of str4d's implementation of EdDSA in Java. You can find the original project's description below. |
| 5 | + |
| 6 | +This fork provides easy-to-use wrapper classes, which, while using non-standard formats, make it very easy to generate key pairs and use them to sign and verify data. |
| 7 | +The implementation uses SHA-512 for any hash operations, PBKDF2 with a 512-bit salt and 1 million iterations to derive secret keys from passwords, and AES-256-CBC-PKCS5 for private key encryption. |
| 8 | +Any input data will be reduced to a constant-size (512 KiB) array by hashing segments to avoid the necessity of caching large amounts of data when signing / verifying large files. |
| 9 | + |
| 10 | +Examples |
| 11 | +-------- |
| 12 | + |
| 13 | +First, you may want to generate a key pair. Use |
| 14 | + |
| 15 | +`Ed25519PrivateKey myPrivateKey = Ed25519PrivateKey.generate();` |
| 16 | + |
| 17 | +to create a new private key. You can use |
| 18 | + |
| 19 | +`Ed25519PublicKey myPublicKey = myPrivateKey.derivePublicKey();` |
| 20 | + |
| 21 | +to fetch your public key from the private key. |
| 22 | + |
| 23 | +Next, you may wish to sign something, using your private key. For instance a file: |
| 24 | + |
| 25 | +`String signature = myPrivateKey.sign(myFile);` |
| 26 | + |
| 27 | +Or, if you want to store the signature directly into another file, use |
| 28 | + |
| 29 | +`myPrivateKey.signToFile(myFile,mySignatureFile);` |
| 30 | + |
| 31 | +At some point, you may wish to verify the signature of a file. Use your public key: |
| 32 | + |
| 33 | +`boolean isSignatureValid = myPublicKey.verifyFromFile(myFile, mySignatureFile);` |
| 34 | + |
| 35 | +Of course it doesn't make much sense if the keys can be kept in memory only. Save them to disk using their `saveAsFile(...)` methods, and restore them using their static `loadFromFile(...)` methods. You have to supply a password to store your private key, which will be used for strong encryption. Keep your private key, and distribute your public key. |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +ed25519-java (original) |
| 40 | +======================= |
| 41 | + |
4 | 42 | This is an implementation of EdDSA in Java. Structurally, it is based on the ref10 implementation in SUPERCOP (see http://ed25519.cr.yp.to/software.html). |
5 | 43 |
|
6 | 44 | There are two internal implementations: |
|
0 commit comments