Chloride

Chloride provides a simple API over Java's crypto functionality. It uses Bouncy Castle to provide support for modern algorithms. The API is loosely modeled after NaCl and libsodium.

Лицензия

Лицензия

Категории

Категории

IDE Инструменты разработки
Группа

Группа

com.jtdowney
Идентификатор

Идентификатор

chloride
Последняя версия

Последняя версия

0.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Chloride
Chloride provides a simple API over Java's crypto functionality. It uses Bouncy Castle to provide support for modern algorithms. The API is loosely modeled after NaCl and libsodium.
Ссылка на сайт

Ссылка на сайт

https://github.com/jtdowney/chloride
Система контроля версий

Система контроля версий

https://github.com/jtdowney/chloride

Скачать chloride

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.jtdowney/chloride/ -->
<dependency>
    <groupId>com.jtdowney</groupId>
    <artifactId>chloride</artifactId>
    <version>0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.jtdowney/chloride/
implementation 'com.jtdowney:chloride:0.1.1'
// https://jarcasting.com/artifacts/com.jtdowney/chloride/
implementation ("com.jtdowney:chloride:0.1.1")
'com.jtdowney:chloride:jar:0.1.1'
<dependency org="com.jtdowney" name="chloride" rev="0.1.1">
  <artifact name="chloride" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.jtdowney', module='chloride', version='0.1.1')
)
libraryDependencies += "com.jtdowney" % "chloride" % "0.1.1"
[com.jtdowney/chloride "0.1.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.bouncycastle : bcprov-jdk15on jar [1.56,)

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

chloride

Build Status

Chloride provides a simple API over Java's crypto functionality. It uses Bouncy Castle to provide support for modern algorithms. The API is loosely modeled after NaCl and libsodium.

Algorithms

Under the hood, chloride uses NSA Suite B Cryptography. This means it uses AES-256-GCM to encrypt data and for asymmetric boxes it uses ECDH with curve P-256 for key agreement.

Requirements

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

Usage

Box (asymmetric encryption)

KeyPair pair1 = KeyPair.generate();
KeyPair pair2 = KeyPair.generate();
Box box1 = new Box(pair1.getPrivateKey(), pair2.getPublicKey());
Box box2 = new Box(pair2.getPrivateKey(), pair1.getPublicKey());

byte[] ciphertext = box1.encrypt("too many secrets".getBytes("UTF-8"));
byte[] plaintext = box2.decrypt(ciphertext);

Secret Box (symmetric encryption)

SecretKey key = SecretKey.generate();
SecretBox box = new SecretBox(key);
byte[] ciphertext = box.encrypt("too many secrets".getBytes("UTF-8"));
byte[] plaintext = box.decrypt(ciphertext);

Security

Chloride uses a random 96-bit nonce value for AES-GCM, which does raise issues if you're encrypting large amounts of data under the same key. That is because the chance of collision with a 96-bit value is much higher. This choice was made due to the specific circumstances on which Chloride was designed to be used. Please be aware of this limitation for your own systems.

If you've discovered a security bug in Chloride, please email John Downey.

Версии библиотеки

Версия
0.1.1
0.1.0