Java Library To Provide Cryptographic Functions
LIBRARY INSPIRED FROM: https://github.com/jtdowney/chloride/
AtomicCrypto uses NSA Suite B Cryptography. This means it uses AES-256-GCM to encrypt data and for asymmetric cryptography it uses ECDH with curve P-256 as default key agreement.
You need to Install Bouncy Castle as a JCE provider.
You need the Java Crypto Unlimited Strength Policy files.
<dependency>
<groupId>com.aayushatharva</groupId>
<artifactId>AtomicCrypto</artifactId>
<version>1.2.1.0</version>
</dependency>
implementation 'com.aayushatharva:AtomicCrypto:1.2.1.0'
KeyPair SenderKeyPair = KeyPair.generate();
KeyPair ReceiverKeyPair = KeyPair.generate();
AsymmetricHub SenderBox = new AsymmetricHub(SenderKeyPair.getPrivateKey(), ReceiverKeyPair.getPublicKey());
AsymmetricHub ReceiverBox = new AsymmetricHub(ReceiverKeyPair.getPrivateKey(), SenderKeyPair.getPublicKey());
byte[] Encrypted = SenderBox.encrypt("Hey!".getBytes("UTF-8"));
byte[] PlainText = ReceiverBox.decrypt(Encrypted);
SecretKey key = SecretKey.generate();
SymmetricHub box = new SymmetricHub(key);
byte[] Encrypted = box.encrypt("Hey!".getBytes("UTF-8"));
byte[] PlainText = box.decrypt(Encrypted);