org.jboss.aerogear:aerogear-crypto

Open Source Libraries for Mobile Connectivity

License

License

Categories

Categories

JBoss Container Application Servers
GroupId

GroupId

org.jboss.aerogear
ArtifactId

ArtifactId

aerogear-crypto
Last Version

Last Version

0.1.6
Release Date

Release Date

Type

Type

jar
Description

Description

Open Source Libraries for Mobile Connectivity
Project Organization

Project Organization

JBoss by Red Hat
Source Code Management

Source Code Management

https://github.com/aerogear/aerogear-crypto-java.git

Download aerogear-crypto

How to add to project

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

Dependencies

provided (1)

Group / Artifact Type Version
bouncycastle : bcprov-jdk16 jar

test (1)

Group / Artifact Type Version
junit : junit jar 4.8.2

Project Modules

There are no modules declared in this project.

Build Status License Maven Central

Project Info
License: Apache License, Version 2.0
Build: Maven
Documentation: https://aerogear.org/docs/
Issue tracker: https://issues.jboss.org/browse/AGSEC
Mailing lists: aerogear-users (subscribe)
aerogear-dev (subscribe)

AeroGear Crypto Java

A Java API to provide an easy way to use cryptography interfaces for developers built on top of javax.crypto and Bouncy Castle to support: AES-GCM authenticated encryption, password based key derivation and elliptic curve cryptography.

Requirements

Installation

Android

The Android platform unfortunately ships an incomplete and outdated version of Bouncy Castle for Android which also makes hard to install an updated version of the library. That said, we had to stick with Spongy Castle, a version of Bouncy Castle repackaged to make it work on Android.

<dependency>
    <groupId>org.jboss.aerogear</groupId>
    <artifactId>aerogear-crypto</artifactId>
    <version>0.1.3</version>
    <classifier>android</classifier>
</dependency>

Regular Java projects

For regular Java EE and Java SE projects, Bouncy Castle will be supported and there is no need to workaround it.

<dependency>
    <groupId>org.jboss.aerogear</groupId>
    <artifactId>aerogear-crypto</artifactId>
    <version>0.1.3</version>
</dependency>

<dependency>
    <groupId>bouncycastle</groupId>
    <artifactId>bcprov-jdk16</artifactId>
    <version>140</version>
</dependency>

Getting started

AeroGear Crypto does not reinvent the wheel by writing encryption algorithms or creating protocols, we still have some sanity. The major goal of this project is to provide simple API interfaces for uber complicated parameters, so let's get started.

Password based key derivation

Pbkdf2 pbkdf2 = AeroGearCrypto.pbkdf2();
byte[] rawKey = pbkdf2.encrypt("passphrase");

Symmetric encryption

//Generate the key
Pbkdf2 pbkdf2 = AeroGearCrypto.pbkdf2();
byte[] privateKey = pbkdf2.encrypt("passphrase");

//Initializes the crypto box
CryptoBox cryptoBox = new CryptoBox(privateKey);

//Encryption
byte[] IV = new Random().randomBytes();
byte[] ciphertext = cryptoBox.encrypt(IV, "My bonnie lies over the ocean");

//Decryption
CryptoBox pandora = new CryptoBox(privateKey);
byte[] message = pandora.decrypt(IV, ciphertext);

Asymmetric encryption

//Create a new key pair
KeyPair keyPairBob = new KeyPair();
KeyPair keyPairAlice = new KeyPair();

//Initializes the crypto box
CryptoBox cryptoBox = new CryptoBox(keyPairBob.getPrivateKey(), keyPairAlice.getPublicKey());

byte[] IV = new Random().randomBytes();
byte[] ciphertext = cryptoBox.encrypt(IV, "My bonnie lies over the ocean");

//Is possible to use the same crypto box instance, but won't happen in real life
CryptoBox pandora = new CryptoBox(keyPairAlice.getPrivateKey(), keyPairBob.getPublicKey());
byte[] message = pandora.decrypt(IV, ciphertext);

We are big believers that there is too much to improve, for this reason you are more than welcome to file a JIRA if you find any issue or discuss the improvements on the mailing list. Security is not an island and it is our responsibility like developers to make it better.

Documentation

For more details about the current release, please consult our documentation.

Development

If you would like to help develop AeroGear you can join our developer's mailing list, join #aerogear on Freenode, or shout at us on Twitter @aerogears.

Also takes some time and skim the contributor guide

Questions?

Join our user mailing list for any questions or help! We really hope you enjoy app development with AeroGear!

Found a bug?

If you found a bug please create a ticket for us on Jira with some steps to reproduce it.

org.jboss.aerogear

AeroGear

Modern App Dev begins here - RealTime GraphQL and Push

Versions

Version
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0