Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

hyperxpro/AtomicCrypto

Repository files navigation

AtomicCrypto [DISCONTINUTED]

PROJECT DISCONTINUTED AND STOPPED

Java Library To Provide Cryptographic Functions

Algorithms

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.

Requirements

You need to Install Bouncy Castle as a JCE provider.
You need the Java Crypto Unlimited Strength Policy files.

How To Use AtomicCrypto In Project

Maven

<dependency>
  <groupId>com.aayushatharva</groupId>
  <artifactId>AtomicCrypto</artifactId>
  <version>1.2.1.0</version>
</dependency>

Gradle Groovy DSL

implementation 'com.aayushatharva:AtomicCrypto:1.2.1.0'

Usage

Asymmetric Cryptography

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);

Symmetric Cryptography

SecretKey key = SecretKey.generate();
SymmetricHub box = new SymmetricHub(key);
         
byte[] Encrypted = box.encrypt("Hey!".getBytes("UTF-8"));
byte[] PlainText = box.decrypt(Encrypted);