Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.Pakhee:Cross-platform-AES-encryption:'
}
dependencies {
implementation("com.github.Pakhee:Cross-platform-AES-encryption:")
}
<dependency>
<groupId>com.github.Pakhee</groupId>
<artifactId>Cross-platform-AES-encryption</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.Pakhee" % "Cross-platform-AES-encryption" % ""
:dependencies [[com.github.Pakhee/Cross-platform-AES-encryption ""]]
This project contains the implementation of 256 bit AES encryption which works on all the platforms (C#, iOS, Android and Node.js). One of the key objective is to make AES work on all the platforms with simple implementation.
<b>Platforms Supported:</b>
iOS
Android
Windows (C#).
Node.js
<b>Features:</b>
Cross platform support. Encryption-Decryption works across C#, iOS, Android and Node.js.
Support for Random IV (initialization vector) for encryption and decryption. Randomization is crucial for encryption schemes to achieve semantic security, a property whereby repeated usage of the scheme under the same key does not allow an attacker to infer relationships between segments of the encrypted message.
Support for SHA-256 for hashing the key. Never use plain text as encryption key. Always hash the plain text key and then use for encryption. AES permits the use of 256-bit keys. Breaking a symmetric 256-bit key by brute force requires 2^128 times more computational power than a 128-bit key. A device that could check a billion billion (10^18) AES keys per second would in theory require about 3×10^51 years to exhaust the 256-bit key space.
<b>How to encrypt a string:</b>
See code samples for more details. You'll have to perform following steps:
<b>How to decrypt a string:</b>
See code samples for more details. You'll have to perform following steps: