« first day (1816 days earlier)      last day (372 days later) » 

DaveRandom "wes" is the plural of "we"
 
!!no
 
3 messages moved from PHP
 
 
2 hours later…
4:50 AM
http_build_query doesn't encode "+" in a float number – #77608
 
 
12 hours later…
4:57 PM
0
Q: Few strings are failed to encrypt using AES256 in Java

Sumanth VaradaThis specific case is coming whenever i tried to encrypt single char strings in application. When i tried to encrypt the same string with main method then i was able to encrypt it. But when i run with the application then this specific issue is coming. I felt this is strange because it is working...

Im facing an issue while encrypting the single char string in application. I can able to do it when i tried to do it with main method
AES 256 Encryption is getting failed for few strings. didn't understand how ?
public static String encryptWithAES256(String strToEncrypt) throws Exception
{
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] encodedhash = digest.digest(KEY.getBytes(StandardCharsets.UTF_8));
IvParameterSpec ivspec = new IvParameterSpec(Arrays.copyOf(KEY.getBytes(),16));
SecretKeySpec secretKey = new SecretKeySpec(encodedhash, AES_ENCRYPTION_ALGORITHM);
Cipher cipher = Cipher.getInstance(CIPHER_TRANSFORMATION);
cipher.init(Cipher.ENCRYPT_MODE, secretKey, ivspec);
return new String(Base64.encodeBase64(cipher.doFinal(strToEncrypt.getBytes(CHARACTER_ENCODING))));
 
 
1 hour later…
Zoe
6:09 PM
4 messages moved from Java
 

« first day (1816 days earlier)      last day (372 days later) »