1

Possible Duplicate:
android encryption/decryption with AES

For the last 7 days i was looking for one,just one android example working correctly regarding AES 128 encryption but i can't,can anybody help ?

Community
  • 1
  • 1
MZ_Abbadi
  • 67
  • 2
  • 5
  • Then I bet you didn't do any search: http://stackoverflow.com/questions/6788018/android-encryption-decryption-with-aes – dumbfingers Nov 20 '12 at 16:42
  • You do not say what you are encrypting. If you wish to encrypt a database, and you will "settle" for AES-256, use SQLCipher for Android: http://sqlcipher.net/sqlcipher-for-android/ – CommonsWare Nov 20 '12 at 16:53
  • 7 days, srlsy ? http://whathaveyoutried.com ? (also, total duplicate => no search done.) – njzk2 Nov 20 '12 at 17:11
  • 1
    I'm confused why this was marked as a duplicate, since the referenced SO answer has numerous indications that it is actually wrong and creates a insecure solution on every one of the answers according to @maarten-bodewes Very confusing. – raddevus Jul 31 '15 at 13:36

1 Answers1

-1

how about http://code.google.com/p/aes-encryption-samples/wiki/HowToEncryptWithJava. i used it and it worked (i'm no expert!)

David M
  • 2,511
  • 1
  • 15
  • 18
  • First of all let me thank you for your feedback,Can i ask you how i can call these classes from activity ? – MZ_Abbadi Nov 20 '12 at 16:54
  • well, i created a "sample" app w/ an EditText (for user input of a "clean" string), a button that gets that "clean" string and encrypts it, and a TextView to display the encrypted string. basic android dev stuff. The functions in the encrypt/decrypt classes are static, so you can call them by: `encryptedString = YourClassName.encrypt(seed, cleanString);` etc. – David M Nov 20 '12 at 17:01
  • but " encrypt " function recive : - cipher - dataBytes did you mean cipher = seed and cleanString = dataBytes ? – MZ_Abbadi Nov 20 '12 at 17:03
  • there should only be two (2) PUBLIC functions: `encrypt(seed, cleanStr)` and 'decrypt(seed, encryptedStr)` – David M Nov 20 '12 at 17:06
  • i swear that AES4all class has just two public functions and encrypt function takes parameter as is explain before .public static byte[] encrypt(Cipher cipher, byte[] dataBytes) – MZ_Abbadi Nov 20 '12 at 17:09
  • all i can say is take a peek at the code (link above)...follow it until you understand what it's doing. good luck! – David M Nov 20 '12 at 17:10