abdullahselek /
AES-Encryption
AES-Encryption is a Java class for encrypting and decrypting strings in Android with AES.
42/100 healthLoading repository data…
simbiose / repository
Encryption is a simple way to encrypt and decrypt strings on Android and Java project.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Encryption is a simple way to encrypt and decrypt strings on Android and Java project.
1º Add JitPack to your build file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
2º Add the gradle dependency
compile 'com.github.simbiose:Encryption:2.0.1'
3º Get an Encryption instance
String key = "YourKey";
String salt = "YourSalt";
byte[] iv = new byte[16];
Encryption encryption = Encryption.getDefault(key, salt, iv);
4º Encrypt your text
String encrypted = encryption.encryptOrNull("Text to be encrypt");
5º Decrypt your text
String decrypted = encryption.decryptOrNull(encrypted);
You can use you own builder
Encryption encryption = new Encryption.Builder()
.setKeyLength(128)
.setKey("YourKey")
.setSalt("YourSalt")
.setIv(yourByteIvArray)
.setCharsetName("UTF8")
.setIterationCount(1)
.setDigestAlgorithm("SHA1")
.setBase64Mode(Base64.DEFAULT)
.setAlgorithm("AES/CBC/PKCS5Padding")
.setSecureRandomAlgorithm("SHA1PRNG")
.setSecretKeyType("PBKDF2WithHmacSHA1")
.build();
See more on Examples folder, there is an Android, a Java and a Kotlin project.
yourByteIvArray
byte[] iv = {-89, -19, 17, -83, 86, 106, -31, 30, -5, -111, 61, -75, -84, 95, 120, -53}; like you can see, 16 bytes in a byte array. So if you want to use this library I recommend you create you own IV and save it :floppy_disk:.encryptOrNull method just uses the encrypt method. The same for the decryptOrNull, just uses the decrypt method.encryptAsync with a Encryption.Callbackto avoid ANR'S. The same for decryptAsyncBuilder manually to the same parameters used in version 1.1 and olds.Fell free to contribute, We really like pull requests :octocat:
Selected from shared topics, language and repository description—not editorial ratings.
abdullahselek /
AES-Encryption is a Java class for encrypting and decrypting strings in Android with AES.
42/100 health