Bad Padding Exception using AES/ECB/PKCS5Padding

Hi, I need some help Tryng to crypt and decrypt a String using AES/ECB/PKCS5Padding
I paste my code below
Crypt
Cipher cipher;
         byte[] pass=new byte[]{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; // just for example
        SecretKeySpec key = new SecretKeySpec(pass, "AES");
        cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
        cipher.init(Cipher.ENCRYPT_MODE, key);        
        byte[] utf8 = da_cifrare.getBytes("utf-8");
        byte[] enc = cipher.doFinal(utf8);
        String cifrata =new String (Base64.encodeBase64(enc));
        return cifrata;
And on the other side Decrypt
Cipher decipher;
           byte[] pass=new byte[]{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; // just for example
           SecretKeySpec key = new SecretKeySpec(pass, "AES");
           decipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
           decipher.init(Cipher.DECRYPT_MODE, key); 
           byte[] buf =Base64.decodeBase64(da_decifrare.getBytes("utf-8"));
           byte[] recoveredBytes = decipher.doFinal(buf);
           String in_chiaro = new String (recoveredBytes,"utf-8");
           return (in_chiaro);I'm getting Bad padding exception when I try to Decrypt, any ideas ??

Nothing obviously wrong but we have no view of your Base64 encoder and decoder. You should check
a) that the bytes of your key are the same in both methods
b) that the bytes resulting in your decrypt methodbyte[] buf =Base64.decodeBase64(da_decifrare.getBytes("utf-8"));are exactly the same as those created in the encrypt method using  byte[] enc = cipher.doFinal(utf8);
      Note - since Base64 consists of only ASCII characters you should use String cifrata =new String (Base64.encodeBase64(enc),"ASCII");and byte[] buf =Base64.decodeBase64(da_decifrare.getBytes("ASCII"));though this flaw should not be the cause of your exception.
Edited by: sabre150 on Dec 15, 2009 12:32 PM

Similar Messages

  • Unusual Bad Padding Exception

    I am writing a class to encrypt licencing information onto a text file in Base64 encoding. This write aspect works fine but the reading the licence back throw a Bad Padding Exception. (error and code below) Any assistance will be much appreciated
    javax.crypto.BadPaddingException: Given final block not properly padded
    at com.sun.crypto.provider.SunJCE_h.b(DashoA6275)
    at com.sun.crypto.provider.SunJCE_h.b(DashoA6275)
    at com.sun.crypto.provider.AESCipher.engineDoFinal
    (DashoA6275)
    at javax.crypto.Cipher.doFinal(DashoA6275)
    at Encryptor.encrypt(Encryptor.java:117)
    at Encryptor.loadAllEncryptedLayerLicences
    (Encryptor.java:158)
    at Encryptor.main(Encryptor.java:183)
    KeyGenerator kgen = KeyGenerator.getInstance("AES");
    kgen.init(128);
    SecretKey skey = kgen.generateKey();
    byte[] raw = skey.getEncoded();
    SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
    Cipher cipher = Cipher.getInstance("AES");
    //encrypt
    cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
    byte[] encrypted = cipher.doFinal(value.getBytes());
    //CONVERT TO BASE64 Encoding
    String s = new sun.misc.BASE64Encoder().encode(encrypted);
    //write the encrypted data to the file
    fos = new FileOutputStream("C:\\aes\\output.properties");
    new PrintStream(fos).println("layerhandle\t"+s);
    fos.flush();
    //fos.close();
    //decrypt
    byte[] buf = new sun.misc.BASE64Decoder().decodeBuffer(value);
    cipher.init(Cipher.DECRYPT_MODE, skeySpec);
    //read from file and decrypt the values
    byte[] unecrypted = cipher.doFinal(buf);
    String word = new String(unecrypted);

    String s = new
    sun.misc.BASE64Encoder().encode(encrypted);
    //write the encrypted data to the file
    fos = new
    FileOutputStream("C:\\aes\\output.properties");
    new PrintStream(fos).println("layerhandle\t"+s);
    fos.flush();
    //fos.close();This looks suspicious. You should close the PrintStream and not just flush 'fos'. Closing the PrintSteam will close 'fos'. This failure to close the print stream could be the cause your problem.
    >
    >
    //decrypt
    byte[] buf = new
    sun.misc.BASE64Decoder().decodeBuffer(value);If there is a problem with decrypt then it may be because you have not read the 'value' or the 'key' properly.

  • Why bad padding exception???

    hi guys
    here i am trying to decrypt the already encrypted string by one different encrpytion algo.
    in the example i have encrypted the string by des and then i tried to decrypt it using blowfish but it gives as the output null instead of a random string...because of a bad padding exception(check line 86). help to remove the exception.
    if we try to decrypt the des encrypted string by des again it give n padding exception. why with blowfish???
    // CIPHER / GENERATORS
    import javax.crypto.Cipher;
    import javax.crypto.SecretKey;
    import javax.crypto.KeyGenerator;
    // KEY SPECIFICATIONS
    import java.security.spec.KeySpec;
    import java.security.spec.AlgorithmParameterSpec;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.SecretKeyFactory;
    import javax.crypto.spec.PBEParameterSpec;
    // EXCEPTIONS
    import java.security.InvalidAlgorithmParameterException;
    import java.security.NoSuchAlgorithmException;
    import java.security.InvalidKeyException;
    import java.security.spec.InvalidKeySpecException;
    import javax.crypto.NoSuchPaddingException;
    import javax.crypto.BadPaddingException;
    import javax.crypto.IllegalBlockSizeException;
    import java.io.UnsupportedEncodingException;
    import java.io.IOException;
    public class StringEncrypter {
    Cipher ecipher;
    Cipher dcipher;
    StringEncrypter(SecretKey key, String algorithm) {
    try {
    ecipher = Cipher.getInstance(algorithm);
    dcipher = Cipher.getInstance(algorithm);
    ecipher.init(Cipher.ENCRYPT_MODE, key);
    dcipher.init(Cipher.DECRYPT_MODE, key);
    } catch (NoSuchPaddingException e) {
    System.out.println("EXCEPTION: NoSuchPaddingException");
    } catch (NoSuchAlgorithmException e) {
    System.out.println("EXCEPTION: NoSuchAlgorithmException");
    } catch (InvalidKeyException e) {
    System.out.println("EXCEPTION: InvalidKeyException");
    public String encrypt(String str) {
    try {
    // Encode the string into bytes using utf-8
    byte[] utf8 = str.getBytes("UTF8");
    // Encrypt
    byte[] enc = ecipher.doFinal(utf8);
    // Encode bytes to base64 to get a string
    return new sun.misc.BASE64Encoder().encode(enc);
    } catch (BadPaddingException e) {
    } catch (IllegalBlockSizeException e) {
    } catch (UnsupportedEncodingException e) {
    } catch (IOException e) {
    return null;
    public String decrypt(String str) {
    try {
    // Decode base64 to get bytes
    byte[] dec = new sun.misc.BASE64Decoder().decodeBuffer(str);
    // Decrypt
    byte[] utf8 = dcipher.doFinal(dec);
    // Decode using utf-8
    return new String(utf8, "UTF8");
    } catch (BadPaddingException e) {
    System.out.println("BAd padding excception");
    } catch (IllegalBlockSizeException e) {
    System.out.println("IllegalBlockSizeException");
    } catch (UnsupportedEncodingException e) {
    System.out.println("UnsupportedEncodingException");
    } catch (IOException e) {
    System.out.println("IOException");
    return null;
    public static void testUsingSecretKey() {
    try {
              String secretString = "code cant be decrypted!";
              SecretKey desKey = KeyGenerator.getInstance("DES").generateKey();
              SecretKey blowfishKey = KeyGenerator.getInstance("Blowfish").generateKey();
         StringEncrypter desEncrypter = new StringEncrypter(desKey, desKey.getAlgorithm());
              StringEncrypter blowfishEncrypter = new StringEncrypter(blowfishKey, blowfishKey.getAlgorithm());
              String desEncrypted = desEncrypter.encrypt(secretString);     
         String desDecrypted = desEncrypter.decrypt(desEncrypted);
         String blowfishDecrypted = blowfishEncrypter.decrypt(desEncrypted);      
         System.out.println(desKey.getAlgorithm() + " Encryption algorithm");
         System.out.println(" Original String : " + secretString);
         System.out.println(" Encrypted String : " + desEncrypted);
         System.out.println(" Decrypted String : " + desDecrypted);
         System.out.println();
         System.out.println(blowfishKey.getAlgorithm() + " Encryption algorithm");
         System.out.println(" Original String : " + desEncrypted);
         System.out.println(" Decrypted String : " + blowfishDecrypted);
         System.out.println();
         } catch (NoSuchAlgorithmException e) {
         public static void main(String[] args) {
         testUsingSecretKey();
    }

    peter_crypt wrote:
    you are right but this is my question. why cant we do that?? it should be possible.by the way i am working on a project for cryptanalysis . there i need to implement it.You need to spend more time studying and less time programming -
    1) Applied Cryptography, Schneier, Wiley, ISBN 0-471-11709-9
    2) Practical Cryptography, Ferguson and Schneier, Wiley, ISBN 0-471-22357-3
    3) Java Cryptography, Knudsen, O'Reilly, ISBN 1-56592-402-9 dated but still a good starting point
    4) Beginning Cryptography with Java, written by David Hook and published by WROX .

  • Bad Padding Exception

    I've got a small program to save/load passwords from a file, but the encryption is causing me a few issues, currently I'm stuck on a bad padding exception (line 120).
    The code can be found here: http://www.rafb.net/paste/results/R8NoZB78.html
    Does anyone know how I can resolve the error? Thanks.

        private String decrypt(String encrypted) {
            try {
                Cipher cipher = Cipher.getInstance("DES");
                cipher.init(Cipher.DECRYPT_MODE, key);
                return new String(Base64.decodeBase64(cipher.doFinal(encrypted.getBytes())));
            } catch (Exception e) { e.printStackTrace(); }
            return null;
        private String encrypt(String plaintext) {
            try {
                Cipher cipher = Cipher.getInstance("DES");
                cipher.init(Cipher.ENCRYPT_MODE, key);
                return new String(cipher.doFinal(Base64.encodeBase64(plaintext.getBytes())));
            } catch (Exception e) { e.printStackTrace(); }
            return null;
        }decrypt()
    string -> encrypted encoded bytes -> encoded bytes -> bytes -> string
    encrypt()
    string -> bytes -> encoded bytes -> encrypted encoded bytes -> string
    I do ask myself first. And no, I still don't get what the problem is - I really think there's something, probably very simple, that I don't know about and that's why I'm not getting this.

  • Bad Padding exception when trying to decrypt the file

    Hi i am trying to decypt a file in java which is encrypted in c++ but i get the pad padding exception
    javax.crypto.BadPaddingException: Given final block not properly padded
         at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
         at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
    public byte[] decrypt(byte[] str) {
    try {
    // Decrypt
         System.out.println("beforedecrypt-->"+str.length);
         byte[] input = new byte[64];
              while(true) {
                        int bytesRead = fin.read(input);
                        if (bytesRead == -1) break;
                        byte[] output = dcipher.update(input, 0, bytesRead);
                   byte[] output = dcipher.doFinal();
         // byte[] utf8 = dcipher.doFinal(str);
         System.out.println("afterdecrypt-->");
    // Decode using utf-8
    return output;
    } catch (javax.crypto.BadPaddingException e) {e.printStackTrace();}
    catch (IllegalBlockSizeException e) {e.printStackTrace();}
    catch (Exception e){e.printStackTrace();}
    return null;
    }

    MuppidiJava wrote:
    Sorry man..i got the same key in java..which you got i followed everything was mentioned... but i did not get the same key using C++ But did you compensate in your Java for the C++ bug I highlighted involving the creation of the bytes from the password? I bet you didn't. Did you even talk to your C++ guys about the bug? I bet you didn't.
    as i said i was not good at it..but your sample cpp code would have fixed it easily. Did you look at the Microsoft Crypto documentation? I bet you didn't. Did you try to learn enough C++ to add in the few lines of code needed to export and print out the generated key? I bet you didn't. Did you try to get the C++ guys to help you on this?
    I runing short of timeSorry but your time management problem is your problem.
    ..thanks for your support..The BadPaddingException problem you have is almost certainly as a result of you not generating the same key bytes in your Java as are being generated by the C++. Since you get the same bytes as I do when not compensating for the C++ bug it is almost certain that the C++ bug is the root cause of your problem. If I compensate for the C++ bug I get a match between my C++ key bytes and my Java key bytes. If you don't spend effort in understanding the C++ bug and how to correct for it in your Java you are stuffed. If you don't spend time learning enough C++ to be able to export the C++ key then you will have great difficulty in proving that you C++ key bytes actually match your Java key bytes. I have explained what the bug is - the Java code to compensate for the bug is actually trivial. I have explained how to export the C++ key - the C++ code for this is small and straightforward. I'm not going to provide the C++ code nor the Java compensation code. This is a 'forum' and not a programming service.
    P.S. You still have a problem with the '.' key on your keyboard.

  • AES/ECB/NoPadding

    Dear ALL,
    I am having a problem AES algorithm
    I'm using AES/ECB/NoPadding
    import java.security.NoSuchAlgorithmException;
    import java.security.Provider;
    import java.security.Security;
    import javax.crypto.Cipher;
    import javax.crypto.KeyGenerator;
    import javax.crypto.SecretKey;
    import javax.crypto.spec.IvParameterSpec;
    import javax.crypto.spec.SecretKeySpec;
    import org.jpos.iso.ISOUtil;
    public class AesTest {
         static Provider p = new org.bouncycastle.jce.provider.BouncyCastleProvider();
         public static void main(String[] args) {
              Security.addProvider(p);
              try {
                   byte aesKeyByte[] =  ISOUtil.hex2byte("EE5C261E5B0FF0E78CFF3D6D65DDB220");
                   byte clearValue[] =  ISOUtil.hex2byte("7C096716F12BAE6B");
                   SecretKey AESKey = new SecretKeySpec(aesKeyByte,"AES");
                   byte enout[] = encrypt(AESKey, clearValue, p, "ECB", null);
                   System.out.println("ENCR DATA : "+ISOUtil.hexString(enout));
                   byte deout[] = decrypt(AESKey, enout, p, "ECB", null);
                   System.out.println("DER DATA : "+ISOUtil.hexString(deout));
              } catch (Exception e) {
                   e.printStackTrace();
         public static byte[] encrypt(SecretKey secretKey, byte[] clearBytes, Provider p,
                   String mode, byte[] IV) throws Exception {
              if ("CBC".equals(mode)) {
                   Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding", p
                             .getName());
                   cipher
                             .init(Cipher.ENCRYPT_MODE, secretKey, new IvParameterSpec(
                                       IV));
                   return cipher.doFinal(clearBytes);
              } else {
                   Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding", p
                             .getName());
                   cipher.init(Cipher.ENCRYPT_MODE, secretKey);
                   return cipher.doFinal(clearBytes);
         public static byte[] decrypt(SecretKey secretKey, byte[] ciperBytes, Provider p,
                   String mode, byte[] IV) throws Exception {
              if ("CBC".equals(mode)) {
                   Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding", p
                             .getName());
                   cipher
                             .init(Cipher.DECRYPT_MODE, secretKey, new IvParameterSpec(
                                       IV));
                   return cipher.doFinal(ciperBytes);
              } else {
                   Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding", p
                             .getName());
                   cipher.init(Cipher.DECRYPT_MODE, secretKey);
                   return cipher.doFinal(ciperBytes);
    }Error
    javax.crypto.IllegalBlockSizeException: data not block size aligned
         at org.bouncycastle.jce.provider.JCEBlockCipher.engineDoFinal(Unknown Source)
         at javax.crypto.Cipher.doFinal(DashoA13*..)
         at AesTest.encrypt(AesTest.java:72)
         at AesTest.main(AesTest.java:41)
    Regards
    Edited by: EJP on 21/07/2011 15:45

    But I'm using ECB mode. So my clear data has 8 byte block
    When I use clear data = 7C096716F12BAE6B7C096716F12BAE6B (16 bytes, two 8 blocks), there is no any exception
    But clear data = 7C096716F12BAE6B7C096716F12BAE6B7C096716F12BAE6B (3 8 blocks ) again getting same error
    Note : I'm not facing this issue with DES algorithm.
    Actually, I don't know length of my clear text, what I'm doing I will make 8 bytes blocks of clear text and used to encrypt it.
    Example
    Clear text = 1111 2 makes 1111 2000 0000 0005
    Can you tell me how to encrypt this kind of data using AES with ECB mode ?
    Regards

  • "Given final block not properly padded" when using wrong secretKey

    Hello guys, I browsed the questions in this forum regarding my problem, but somehow couldn't find a solution to this.
    I generated two SecretKey key1 and key2. Now I'm using the Cipher class to encrypt a message to key1. If I try to decrypt it with key1, everything works fine. But if I try key2 I get the "Given final block not properly padded"-message in my exception backtrace instead of just unreadable stuff, which I excepted (using the wrong key). This happens regardless of the symetric algorithm I use.
    Can you help me?
    Thanks,
    Sebastian

    Most symmetric algorithms work on data of a given block-size. If your data isn't a multiple of that size, it's padded. This removes a clue that a cryptanalyst can use to try and break your encryption. At decrypt time, the Cipher expects to see padding-related bits at the end of the stream, so it knows how many pad-bits were stuck on to begin with. When the end of the stream doesn't match the expected padding-protocol, you get the exception noted.
    Now - if you decode with the wrong key, you get junk. The chances of that junk ending with a valid padding-indicator is...small. So you're more likely to see "BadPadding" than a valid (if incorrect) plaintext.
    You could use "NoPadding" on both ends, and do your own manipulation of the bit-stream to make the Cipher happy. Then, you wouldn't get BadPadding exceptions. But you'd have to write some pretty fiddly code on each end.
    Anybody else want to double-check me on this? I'm away from my books at the moment. Floersh? Euxx?
    Good luck,
    Grant

  • Using AES - Creating password?

    Hello everyone,
    What I want to do is encrypt data using AES, and encrypt it with a password, like making a Key be a certian String. Instead of using a generated key, because I want people to be able to view this whenever,
    KeyGenerator kgen = KeyGenerator.getInstance("AES");
           kgen.init(128);
           SecretKey skey = kgen.generateKey();Instead of generating a key, I want to be able to use a password like "test" or anything like that. But I don't see how I can do that, I think I am just missing something.
    Thanks for any help,
    ON a side note: If anybody can tell me how I can use AES 256, that would be great but its not that important.

    Now I get an error, this is the code that the error is surrounding
    KeyGenerator kgen = KeyGenerator.getInstance("AES");
           kgen.init(128); // 192 and 256 bits may not be available
           // Generate the secret key specs.
           //Key password = kgen.
           char[] SecretPhrase ={'M', 'y', 'P', 'a', 's', 's', 'w', 'o', 'r', 'd'};
           PBEKeySpec pbeKeySpec = new PBEKeySpec(SecretPhrase);
           SecretKeyFactory skeyFactory = SecretKeyFactory.getInstance("DES");
           SecretKey secretKey = skeyFactory.generateSecret(pbeKeySpec);
           //SecretKey skey = kgen.generateKey();
           byte[] raw = secretKey.getEncoded();
          // String password = "test";
          // byte[] pass = password.getBytes();
           SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
           // Instantiate the cipher
           Cipher cipher = Cipher.getInstance("AES");
           cipher.init(Cipher.ENCRYPT_MODE, skeySpec);The error
    Exception in thread "main" java.security.spec.InvalidKeySpecException: Inappropriate key specification
         at com.sun.crypto.provider.DESKeyFactory.engineGenerateSecret(DashoA13*..)
         at javax.crypto.SecretKeyFactory.generateSecret(DashoA13*..)
         at EncryptionMethods.Main.main(Main.java:60)Line 60 is
      SecretKey secretKey = skeyFactory.generateSecret(pbeKeySpec);

  • How many implmentation allowed of BAdi with multiple use option???

    Dear all ,
                        I have doubt in BAdi implementation -
    Case 1 -  I have create a z badi with multiple use option enabled . than i create two implementation of that BAdi . when i call it from my z program than it will call only one which was created 1st  so what is use of 2nd implementation and when it will call ???
    Case 2 - Same case for tcode VD02 their is badi CUSTOMER_ADD_DATA which is also multiple option enable Badi
                  for this also i have created 2 implementation but in this case when i create 2nd implementation it asked for migration of implementation why ???
    Thanks

    Dear deepak ,
                            i have check it both implementation showing yellow color please check my z program and tell me what is wrong in this .
    REPORT  Y_BADI_EXP1.
    CLASS cl_exithandler DEFINITION LOAD.
    DATA : l_badi TYPE REF TO ZIF_EX_MYBADI,
           email TYPE AD_SMTPADR,
           email1 TYPE AD_SMTPADR..
    PARAMETERS : p_user TYPE sy-uname.
    START-OF-SELECTION.
    CALL METHOD CL_EXITHANDLER=>GET_INSTANCE
    EXPORTING
      EXIT_NAME                     = 'ZMYBADI'
    NULL_INSTANCE_ACCEPTED        = 'X'
    CHANGING
      INSTANCE                      = l_badi               " here it will return 2 implementation  ZMYBADI_IM1 , ZMYBADI_IM2
    EXCEPTIONS
      NO_REFERENCE                  = 1
      NO_INTERFACE_REFERENCE        = 2
      NO_EXIT_INTERFACE             = 3
      CLASS_NOT_IMPLEMENT_INTERFACE = 4
      SINGLE_EXIT_MULTIPLY_ACTIVE   = 5
      CAST_ERROR                    = 6
      EXIT_NOT_EXISTING             = 7
      DATA_INCONS_IN_EXIT_MANAGEM   = 8
      OTHERS                        = 9
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD l_badi->GET_USER_EMAILID
    EXPORTING
      uname = p_user
    CHANGING
      emaill = email.
    WRITE : /5 email.       " when o/p comes it shows only 1st implementation .
    i placed break point in methods of both  implementation but as usual it stop only at first method ???

  • How to log the exception using Log action in Oracle Service Bus

    Hi,
    Whenever an exception is raised how to log the exception using Log action in oracle service bus.After logging where I have to find the logged message.

    It would be in the log file for the managed server which ran the request. If you are logging the message at a lower level than your app server, however, you won't see it. You should be logging the exception at Error level.

  • Application Exception using @Application not working

    I'm trying to create 2 business application exception using the @Application annotation on my 2 java exception class. The first exception is a StarException class that extends java.lang.Exception (per ejb 3.0 spec). Below is snippet of the class.
    @ApplicationException(rollback=true)
    public class StarException extends Exception {...}.
    As you can tell that this is a check exception and will rollback transaction when it occurred. I have another exception class called StarRuntimeException that extends java.lang.RuntimeException. This is also mention on ejb 3.0 spec and is useful if you don't want to catch the exception on the server side and just throw it and the client will receive such application exception class. Below is a snippet of the class ...
    @ApplicationException(rollback=false)
    public class StarRuntimeException extends RuntimeException {...}.
    By the way I'm using this exception in my wls 10.3 webservices stateless beans (jax-rpc 1.1). Some of the methods throws these 2 exceptions.
    There are 2 problems with this application exception during runtime on the client side.
    1. Regarding StarException, the client can catch this exception when the webservice method throws this exception. The problem is that the error messages is null. Tried both getMesssage() and getLocalizedMessage() are all null.
    2. Regarding StarRuntimeException, the generated client stubs and artifacts does not even throw this exception, therefore it will not the caught. This exception is wrapped inside RemoteException instead.
    Your help are needed. Thanks

    Ok. I figured it out. The url rewrite was missing in the config. Put it there and its working now.

  • Decryption of image using AES in windows 8.1

     Hi ,
        I am developing an app in windows 8.1, in which I got image in decryption format ,
    it was encrypted using AES and I know the key
    I tried in oneway but i am getting an error "The supplied user buffer is not valid for the requested operation"
    please help how to decrypt the image and bind it to ui
    Thanks
    Sarvesh
    sarvesh

    Hi Sarvesh,
    I've replied you in another thread, please feel free to check it :)
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Why in the world would Apple make the track pad LESS useful in OS Lion?  I hate that I can't g back to the top of a web page with a singe swipe.  And of course all the other gestures are totally reversed.  IMHO, this was not an imporvement.

    Why in the world would Apple make the track pad LESS useful in OS Lion?  I hate that I can't g back to the top of a web page with a singe swipe.  And of course all the other gestures are totally reversed.  IMHO, this was not an improvement.

    No one here works for Apple.
    Go to System Preferences > Trackpad > Scroll & Zoom, and uncheck Scroll direction: Natural.

  • Matrix Bad Value exception in ItemCode column

    hello ,
    i faced an exception with filling itemcode column
    As u know this column is linked object and have CFL (choose from list)
    the problem i faced that on choosing from list i choose an item to add new line in matrix
    this event done and a new line added sucessfully
    but the problem was with CFL , that it didnt able to close , it still opened and you need to press ESC or click on cancel to close it
    when i tracking the exception i found "Bad value" exception, although the itemcode column filled but the
    also i bind all matrix columns with data sources and i can fill matix at first , but when i want to add new line i faced this problem
    best regards and thank you in advance ....
    Ammar

    Thanks Rasmus,
    But that's something I've already tried - it doesn't seem to make any difference.

  • How to run exception using JSP?

    How to run exception using JSP?

    Why would you need the <%%> between the if else blocks? Even if you attempt to write some data within the blocks in java, you will still get an error. For example, this is illegal:
    if(done)
        System.out.println(true);
    System.out.println("Hello World");
    else
        System.out.println(false);
    }The compiler is expecting the 'else' to be directly after the body of the if. If it encounters anything else, it will complain. So you cannot do this in jsp either, regardless if it's a different technology, it's the same compiler.

Maybe you are looking for

  • Quad only one core in Vista.

    Hello, I just set my new system up: P35 Platinum (v1.0 BIOS) Q6600 2gig Gskill 8800GTS X-Fi Vista Home Premium I upgraded from a an Opteron 165 system that had shown both cores. Do I need a BIOS update? I've actually been trying for the past hour to

  • 3 seconds for web service to call another web service

    Greetings All, I am curious as to why a PowerBuilder WebService, written in PB12.5, calling any other webservice (PowerBuilder or otherwise), takes 3 seconds to connect. Our PowerBuilder webservices, when called either from external sources, or from

  • Integration of Check Register with Classic Payment Programs

    Hello, I know you can integrate the check register with electronic payments via the payment medium workbench. Is there any way to achieve the same integration using classic payment media programs like RFFOUS_T? Thanks!

  • Problem with starting devices at terminal server

    Hi all, I got a problem I can't solve at my terminal server. In order to provide the Java ME SDK for home office use i installed it at our terminal server (Win2003Server Standard 32Bit) as administrator. Our developers access it via RDP. Now I got a

  • Three questions about my new X61s

    1. The operation system I ordered is Vista Business with downgrade to XP. Now Xp is preinstalled, but there is no Vista installation CD.  I only have a Vista Product ID on the back side of my laptop. How can I upgrade my operation system when I find