AES encryption free extension

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:

7 Likes

What AES is that? :sweat_smile:
AES-128, AES-256…

Just to clarify

in this case your extension useless… if someone likes to use encryption, then it should be as safe as possible…

Encrypting strings in Android: Let’s make better mistakes
https://tozny.com/blog/encrypting-strings-in-android-lets-make-better-mistakes/

If you do a web search for “encrypting Strings in Android”, you’ll find a lot of example code on sites like Stack Overflow, but those examples are wrong. They definitely input a String and output gibberish that looks like encrypted text, but they are subtly insecure and even dangerous. Crypto is tricky: it’s hard to tell that the gibberish that’s being printed is not good crypto, and it’s hard to tell that the code example you picked up from Stack Overflow has serious flaws.

Taifun
https://puravidaapps.com/aes.php

3 Likes

AES 128 , using ECB (which is not the most secure mode to use AES, but I judged , wrong or not, that for my needs and for the majority of users which haven’t the safe of Fort Knox to defend, it’s enough). Everyway, I’ll try to improve in the next future!

if someone needs to use encryption, then he/she likes to do it correctly and not only a little bit
this is not dependent on the development environment

Taifun

1 Like

After a while, I had time to review and totally change the extension. Now the encryption is stronger while the algorythm is the same AES with a 128 keysize. I hope to have improved the fisrt attempt and maybe, in future, I would like to add more options.
See the first post for new link

1 Like

A new version and a demo have been uploaded, see first post

3 Likes

Next version uses CBC method,not ECB method right? So new version is more secure than old version,right?

Yes you are right

1 Like

Just point it out… is there a MD5 encryption available there?

Hello, the community language is english, so please translate your language into english before you post.

If i encrypt post data by this extension and sent to my server… how can i decrypt this data through php .

I made a library that can do exactly what you want. The library can decrypt and encrypt text, using the same algorithm! (also works with taifuns’s extension).
https://projects.technerd.at/aeslib/
Best regards!

2 Likes

Demo apk link not working, please update link

extension link is not working

Yes extension link is dead! Please update.
Edit:
Here is the new links:
extension
demo

I’m looking for a way to encrypt string in the app and decrypt it on python (server side).
I try to decrypt the encoded text from this extension with this online tool but not working, got error

Length of secret key should be 16 for 128 key size.

How to decrypt that?

Tired, i’m going to try to encrypt it AES by Javascript instead…

there is a php library by Stefan, which is able to decrypt data server side… at least this is working together with my AES extension

Taifun

A post was split to a new topic: How to decrypt encrypted data generated by the Crypthography component on a webpage?

Greetings! Do you have this in JS Node ? Or can some one help convert this PHP to JS Node code?