Here I’m, I rechecked my old extension and now it works fine. I enclose a demo too and a new link.
This extension has been revised and now it is supported by Tozny’s great work about AES encryption, to which I’m debtor for this project .
The AES 128 is encrypted in CBC mode with PKCS5 padding. The cyphertext and random IV generated during the process are kept together, so no need to store the latter somewhere. The integrity of cyphertext is assured by SHA256 , whose digest is kept together with the generated key.
How it works:
SetAlgorythm
At present only AES is implemented, so the numeric value possible is “1”
MyPassword
If you want to use a personal password set TRUE else for a random key set FALSE
GenerateStrongKey
attach a password here if MyPassword is TRUE or a blank string if FALSE
then save safely this result somewhere for encryption/decryption process
Encrypt
myPassword param. needs your password if MyPassword is TRUE or a blank string if FALSE
secret param. needs the result of GenerateStrongKey
stringToEncrypt param. needs a string with text to encrypt
Decrypt
myPassword param. needs your password if MyPassword is TRUE or a blank string if FALSE
secret param. needs the result of GenerateStrongKey
stringToDecrypt param. needs a string with a ciphertext generated with Encrypt
New link as per current version
com.tiziano1960.cryptoextension.aix (28,5 KB)
and here’s a demo
CryptoExtensionDemo.apk (2,2 MB)
Example of use: