All Projects → skavinvarnan → Cross Platform Aes

skavinvarnan / Cross Platform Aes

Licence: mit
Simple cross-platform encryption and decryption using AES

Programming Languages

javascript
184084 projects - #8 most used programming language
swift
15916 projects

Projects that are alternatives of or similar to Cross Platform Aes

Python-File-Encryptor
Encrypt and Decrypt files using Python (AES CBC MODE)
Stars: ✭ 51 (-59.84%)
Mutual labels:  encryption, aes, aes-encryption, decryption
Gonnacry
A Linux Ransomware
Stars: ✭ 341 (+168.5%)
Mutual labels:  encryption, aes, decryption, aes-encryption
Hat.sh
encrypt and decrypt files in your browser. Fast, Secure client-side File Encryption and Decryption using the web crypto api
Stars: ✭ 886 (+597.64%)
Mutual labels:  encryption, aes, decryption, aes-encryption
abrute
Multi-threaded AES Brute Force File Decryption
Stars: ✭ 22 (-82.68%)
Mutual labels:  aes, aes-encryption, decryption
Jsrsasign
The 'jsrsasign' (RSA-Sign JavaScript Library) is an opensource free cryptography library supporting RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp, CAdES JSON Web Signature/Token in pure JavaScript.
Stars: ✭ 2,760 (+2073.23%)
Mutual labels:  encryption, aes, decryption
Laravel Database Encryption
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Stars: ✭ 238 (+87.4%)
Mutual labels:  encryption, aes, decryption
AESCipher-Java
AES encryption working between Objective-C and Java.
Stars: ✭ 88 (-30.71%)
Mutual labels:  aes, aes-encryption, decryption
EasyAES
AES encrypt/decrypt, Android, iOS, php compatible(兼容php, Android, iOS平台)
Stars: ✭ 79 (-37.8%)
Mutual labels:  encryption, aes, decryption
Cryptr
A simple shell utility for encrypting and decrypting files using OpenSSL.
Stars: ✭ 81 (-36.22%)
Mutual labels:  encryption, decryption, aes-encryption
Link Lock
Password-protect URLs using AES in the browser; create hidden bookmarks without a browser extension
Stars: ✭ 418 (+229.13%)
Mutual labels:  encryption, aes, aes-encryption
Encryptor4j
Strong encryption for Java simplified
Stars: ✭ 92 (-27.56%)
Mutual labels:  encryption, aes, decryption
Padding Oracle Attacker
🔓 CLI tool and library to execute padding oracle attacks easily, with support for concurrent network requests and an elegant UI.
Stars: ✭ 136 (+7.09%)
Mutual labels:  encryption, aes, decryption
Xjar
Spring Boot JAR 安全加密运行工具,支持的原生JAR。
Stars: ✭ 692 (+444.88%)
Mutual labels:  encryption, aes, decryption
Py7zr
7zip in python3 with ZStandard, PPMd, LZMA2, LZMA1, Delta, BCJ, BZip2, and Deflate compressions, and AES encryption.
Stars: ✭ 110 (-13.39%)
Mutual labels:  encryption, aes, decryption
Aescipher Ios
AES encryption working between Objective-C and Java.
Stars: ✭ 198 (+55.91%)
Mutual labels:  aes, decryption, aes-encryption
EncrypC
🔑 File Encryption Application using Python.
Stars: ✭ 14 (-88.98%)
Mutual labels:  encryption, aes, aes-encryption
Secure Ls
🔒 Secure localStorage data with high level of encryption and data compression
Stars: ✭ 486 (+282.68%)
Mutual labels:  encryption, decryption, aes-encryption
Hybrid Crypto Js
RSA+AES hybrid encryption implementation for JavaScript. Works with Node.js, React Native and modern browsers.
Stars: ✭ 87 (-31.5%)
Mutual labels:  encryption, aes, decryption
Iocane
An odorless, tasteless NodeJS crypto library that dissolves instantly in liquid
Stars: ✭ 35 (-72.44%)
Mutual labels:  encryption, decryption
Horizoncrypt
Animal Crossing: New Horizons Save Encryptor/Decryptor
Stars: ✭ 36 (-71.65%)
Mutual labels:  encryption, decryption

Cross platform 256bit AES encryption / decryption

This project contains the implementation of (iOS Objective C, iOS Swift, Android, Java, Javascript, NodeJS)

Platforms supported

  1. iOS
  2. Android
  3. NodeJS
  4. PHP

Features:

  1. Cross platform support. Encryption-Decryption works across iOS, Android and Node.js.

  2. Automatically RandomIV is added while encryption and remove first randomized blocks while decryption.

  3. 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.

  4. 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.

One of the key objective is to make AES work on all the platforms with simple implementation.

Complex logics such as generating IV and sha256 the key are done within the library.

Simple Approach

All Platforms

Pass in the plainText as String, Pass in the key as String. Both the encrypted and decrypted data are also String. key is converted to 256-bit within the library for Android, iOS and NodeJS

iOS / Swift 3, 4

Add a bridging header. Apple documentation

#import "CryptLib.h"
let plainText = "this is my plain text"
let key = "your key"

let cryptLib = CryptLib()

let cipherText = cryptLib.encryptPlainTextRandomIV(withPlainText: plainText, key: key)
print("cipherText \(cipherText! as String)")

let decryptedString = cryptLib.decryptCipherTextRandomIV(withCipherText: cipherText, key: key)
print("decryptedString \(decryptedString! as String)")

Android

val plainText = "this is my plain text"
val key = "your key"

val cryptLib = CryptLib()

val cipherText = cryptLib.encryptPlainTextWithRandomIV(plainText, key)
println("cipherText $cipherText")

val decryptedString = cryptLib.decryptCipherTextWithRandomIV(cipherText, key)
println("decryptedString $decryptedString")

Javascript / NodeJS / Web

Download the library

npm install @skavinvarnan/cryptlib --save
const plainText = "this is my plain text";
const key = "your key";

const cryptLib = require('@skavinvarnan/cryptlib');

const cipherText = cryptLib.encryptPlainTextWithRandomIV(plainText, key);
console.log('cipherText %s', cipherText);

const decryptedString = cryptLib.decryptCipherTextWithRandomIV(cipherText, key);
console.log('decryptedString %s', decryptedString);

PHP

Download the package

composer require ahsankhatri/cryptolib-php
$string     = 'this is my plain text';
$secretyKey = 'BlVssQKxzAHFAUNZbqvwS+yKw/m';

$encryption = new \MrShan0\CryptoLib\CryptoLib();

$cipher  = $encryption->encryptPlainTextWithRandomIV($string, $secretyKey);
echo 'encryptedString: ' . $cipher . PHP_EOL;

$plainText = $encryption->decryptCipherTextWithRandomIV($cipher, $secretyKey);
echo 'decryptedString: ' . $plainText . PHP_EOL;

Output

encryptedString ___Cipher Text will be generated here___
decryptedString this is my plain text

Few Tests

Here are few cipher texts. Try decrypting with iOS or Android or NodeJS.

Basic Example:

Cipher Text: "GfTE0IK4zk039+042LwPvsTjr0A8LqBDcxDWAc41YmwxNjZVJ3CcuDxWXsulbUjE"
Cipher Text: "53zydKWD3CJCoSm9YBYaV+pwwGtSP/f36nIfUnRV3GwTFsQXgX84nh0Tu6JpsHkf"
Cipher Text: "h0PMUJhigwVnJZD43i9q98b/AG7GUg8T2BdsQ4Yun2dQHPqSE5QF0RSiHUW0wguc"
Cipher Text: "EhYJzR5oaziXCSJ2ha63Oun6HXLkCILWuJWVUAl64JpU3OdvKNyoA3rKuOj+qfEO"

key: "your key"

Output Plain Text: "this is my plain text"

Example special characters:

Cipher Text: "71g9R98ALCvYD0AVCtNJhEik/00jvon+ductEBlt601Er6tqFrtH0kIB+62O2DPiEsKcSilUez2MXsyGzA2Z9KM8h/tiLmM6psaSLaFELXw="
Cipher Text: "f9ofx42+h5SzJI5sXa+NExyCpxXRdhLcYcuvAsX6qCkxEw10GMzYCnSslV5Ku3v5w96QlHVceLn6yBcUBeZHlpbcnKv38ZKCGxTTv95gIN0="
Cipher Text: "CvG+gJuY5mrcjQa5OfGSA39tQtgEK1fj/OMR8Jaw2XmBOGLWJvII6nNfSvhhGLYG31X65wSLTy6Naz/OTrkEA7KOlpM5PYPpjbY06JA7zHg="
Cipher Text: "C7Bc+bSC1cri0DJ6nLoGoslfMPb4nVea0xHla8nQaOilPTpAx5N8ziLZC7UhpdiSnzYqRmh0WiH5u0wJmAn0JEEFqsxhW6z0biFmT6p8x1s="

key: "%^^&&@(*&@##)@)@``~~"

Output Plain Text: "This is a my #&^&*#&^@@# PLAIN (.)(.) TEXT (@*&#(*^---"

Advance Approach

Refer the source code

Thanks to Cross-platform-AES-encryption

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].