Giter Site home page Giter Site logo

bmoliveira / lazysodium-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from terl/lazysodium-android

1.0 1.0 0.0 1.6 MB

An Android implementation of the Libsodium cryptography library. For the lazy dev.

License: Mozilla Public License 2.0

Java 100.00%

lazysodium-android's Introduction



Lazysodium for Android

Lazysodium is a complete Android implementation of the Libsodium library that provides developers with a smooth and effortless cryptography experience.

Download

Why Lazysodium

We created Lazysodium because we really wanted a solid Libsodium compatible Java/Android library that would just work without fuss. We were exasperated and annoyed with current Libsodium implementations as some of them were just poorly maintained and poorly architected.

You can find more info here.

Used by

Name Short description Android Java
Threema (SaltyRTC) Threema is a global end-to-end encrypted chatting app and SaltyRTC is their protocol for encryption.
PayPay CardPaymentSDK is a card payments library to make payments through several payment methods painless. It uses PayPay as an endpoint to establish a payment security channel.
RDACAA Used by the government of Ecuador's Ministry of Health to encrypt and sign a list of ambulatory care and consultations.
E3DB An encrypted NoSQL database designed from the ground-up for user privacy and security.
ADAMANT The most private messenger possible. Your device does not store any info. It directly interacts with the blockchain, where every byte is fully-encrypted.
Kepler A small TCP server written in Java powered by Netty, an asynchronous networking library.
Regen Ledger A global marketplace & contracting platform for Earth's ecosystem assets, services, and data.
Tezos The TezosJ SDK library enables plain Java developers to create applications that communicates with Tezos blockchain.
Exonum Exonum Java Binding is a framework for building blockchain applications in Java, powered by Exonum.
Paseto Java Implementation of Platform-Agnostic Security Tokens.
Recordo A super secure diary/journal that provides end to end encryption.

Features

You can find an up-to-date feature list here.

Quick start

This is by no means a comprehensive introduction to Lazysodium. Please view the official documentation for a more comprehensive guide.

1. Install

Install by adding the bintray repository and the dependency. For Maven users, please see here.

// Top level build file
repositories {
    maven {
        url  "https://dl.bintray.com/terl/lazysodium-maven"
    }
}

// Add to dependencies section
dependencies {
    implementation "com.goterl.lazycode:lazysodium-android:VERSION_NUMBER@aar"
}

Substitute VERSION_NUMBER for the version in this box:

Download

2. Let's go!

You can now initialise and start encrypting! Please note that this library follows the official libsodium docs closely. You need to use those docs to help you find the functions you need.

// Let's initialise LazySodium, perhaps in an Application class somewhere
LazySodiumAndroid lazySodium = new LazySodiumAndroid(new SodiumAndroid());

// Now you can cast to an interface so that our
// IDE picks up and intelligently loads up the correct methods. 
SecretBox.Native secretBoxNative = (SecretBox.Native) lazySodium;
SecretBox.Lazy secretBoxLazy = (SecretBox.Lazy) lazySodium;

// The first one is Lazysodium's Native implementation which
// is just like libsodium's native C function but with tiny enhancements
// to make your life easier.
secretBoxNative.cryptoSecretBoxKeygen(key);
// Convert key to string and save to DB

// This one is Lazysodium's Lazy implementation which makes
// your work with cryptography super easy.
String key = secretBoxLazy.cryptoSecretBoxKeygen();

In the above code there are two ways you can use Lazysodium. The first way is through the Native interface. The second is through the Lazy interface.

3. You decide

Every project is different, you may need to use lower-level APIs to achieve the control you need so you use the Native interface. Or alternatively you just don't want to deal with the details so you stick to the Lazy interface.

Every interface you can cast to is helpfully all in one directory so you can easily pick the functions you need. This isolates your code and prevents you from making mistakes.

Important: If possible, please stick to using either the Native or the Lazy interface. The reason for this is that the Lazy interface normally converts everything to hexadecimal whereas the Native interface assumes everything is non-hexadecimal. If you don't know what you're doing, you could end up making mistakes.

Documentation

See our official documentation to get started.

Apps

You can preview some of the features in our free Lazysodium app available on Google Play:

Get it on Google Play

Lazysodium for Java

We also have a Java implementation available at Lazysodium for Java. It has the same API as this library so you can share code easily!


Created by Terl.

lazysodium-android's People

Contributors

gurpreet- avatar m4dc4p avatar

Stargazers

 avatar

Watchers

 avatar

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.