Secrete is a simple ECIES implementation that uses Curve25519.
The Elliptic Curve Integrated Encryption Scheme has been implemented with the following specifications:
| Item | Specification |
|---|---|
| Elliptic Curve | Curve25519 |
| Key Derivation Function | KDF2 |
| Message Authentication Code | HMAC with SHA512 |
| Symmetric Encryption Scheme | AES-256 CBC mode with PKCS7 Padding |
using source code from existing repositories, including:
Many thanks to Trevor Bernard and the guys of The Legion of the Bouncy Castle.
The binary distribution can be downloaded from the releases page.
java -jar secrete.jar genKeysThis will generate the two files public.key and private.key under the .secrete folder in the user's home.
A password will be required to protect the private key.
The private key is stored using PBKDF2 with SHA-512 and AES-256 CBC mode with PKCS7 Padding.
To change the password of the private.key under the .secrete folder, use:
java -jar secrete.jar changePwdjava -jar secrete.jar -o <key_file> exportKeyjava -jar secrete.jar -k <recipient_key_file> encryptInsert the message ending with a "."; the encrypted message will be displayed encoded in Base64.
It is also possible to output the encrypted message to a binary file by specifying the "-o" option:
java -jar secrete.jar -k <recipient_key_file> -o <encrypted_file> encryptjava -jar secrete.jar decryptInsert the Base64 encrypted message, and the password to unlock the private key.
It is also possible to load the encrypted message from the binary file by specifying the "-i" option:
java -jar secrete.jar -i <encrypted_file> decryptjava -jar secrete.jar -k <recipient_key_file> -i <file_to_encrypt> -o <encrypted_file> encryptjava -jar secrete.jar -i <encrypted_file> -o <decrypted_file> decryptInsert the password to unlock the private key.
Secrete can be used as a library, via the Maven Central Repository:
<dependency>
<groupId>net.nharyes</groupId>
<artifactId>secrete</artifactId>
</dependency>The main classes to use are:
net.nharyes.secrete.curve.Curve25519KeyPairGeneratornet.nharyes.secrete.ecies.ECIESHelper
Check the ECIESHelper unit tests for some usage examples.
GitHub @gherynos
Secrete is licensed under the Apache License 2.0 since version 1.0.2.