help: encryption/decryption in android


Last Updated:

  1. vkrishna17

    vkrishna17 New Member This Topic's Starter

    Joined:
    May 6, 2010
    Messages:
    3
    Likes Received:
    0
    I am writing an application which encrypts and decrypts the user notes based on the user set password. i used the following algorithms for encryption/decryption 1. PBEWithSHA256And256BitAES-CBC-BC 2. PBEWithMD5And128BitAES-CBC-OpenSSL
    e_Cipher = Cipher.getInstance(PBEWithSHA256And256BitAES-CBC-BC);
    d_Cipher = Cipher.getInstance(PBEWithSHA256And256BitAES-CBC-BC);
    e_Cipher.init()
    d_Cipher.init()
    encryption is working well, but when trying to decrypt it gives
    Exception - Illegal Block size
    after encryption i am converting the cipherText to HEX and storing it in a sqlite database. i am retrieving correct values from the sqlite database during decyption but when calling d_Cipher.dofinal() it throws the Exception.

    I thought i missed to specify the padding and tried to check what are the other available cipher algorithms but i was unable to found.
    so request you to please give the some knowledge on
    what are the cipher algorithms and padding that are supported by Android? if the algorithm which i used can be used for padding, how should i specify the padding mechanism?

    I am pretty new to Encryption so tried a couple of algorithms which are available in BouncyCastle.java but unsuccessful.
     

    Advertisement
  2. vkrishna17

    vkrishna17 New Member This Topic's Starter

    Joined:
    May 6, 2010
    Messages:
    3
    Likes Received:
    0
    can anyone help me on this????
     
  3. KlaymenDK

    KlaymenDK Well-Known Member

    Joined:
    May 29, 2009
    Messages:
    1,217
    Likes Received:
    130
    Welcome to the forum! :D

    Hey, it's only been a few hours. Your subject line is quite good, someone will no doubt get back to you "soon". In the meantime, try to be patient. I know it's difficult. :eek:

    Incidentally, it's good policy to search for threads with zero responses, to look for questions that need answering. So, by adding your 2nd post to this thread, you've actually done yourself a disservice because your thread no longer shows up in 0-response searches. Now you know.

    Good luck!
     

Share This Page

Loading...