GithubHelp home page GithubHelp logo

secrete's Introduction

Secrete

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.

Binary version

The binary distribution can be downloaded from the releases page.

Usage

Generate the key pair

java -jar secrete.jar genKeys

This 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.

Change the private key password

To change the password of the private.key under the .secrete folder, use:

java -jar secrete.jar changePwd

Export the public key

java -jar secrete.jar -o <key_file> exportKey

Encrypt a text message

java -jar secrete.jar -k <recipient_key_file> encrypt

Insert 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> encrypt

Decrypt a text message

java -jar secrete.jar decrypt

Insert 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> decrypt

Encrypt a file

java -jar secrete.jar -k <recipient_key_file> -i <file_to_encrypt> -o <encrypted_file> encrypt

Decrypt a file

java -jar secrete.jar -i <encrypted_file> -o <decrypted_file> decrypt

Insert the password to unlock the private key.

Library usage

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.Curve25519KeyPairGenerator
  • net.nharyes.secrete.ecies.ECIESHelper

Check the ECIESHelper unit tests for some usage examples.

Author

GitHub @gherynos

License

Secrete is licensed under the Apache License 2.0 since version 1.0.2.

secrete's People

Contributors

dependabot[bot] avatar gherynos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

secrete's Issues

Maven Release

Publish library to maven central to be able to use it inside applications

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.