From 81d41f0cdfadbe9e997653ebb0b356bd1af19bd8 Mon Sep 17 00:00:00 2001 From: Sachin Kumar Agrawal Date: Thu, 24 Dec 2015 12:33:29 +0530 Subject: [PATCH 1/2] Update PubnubCryptoCore.java --- java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java b/java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java index 81ac22af5..56c2fe3fc 100644 --- a/java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java +++ b/java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java @@ -93,7 +93,7 @@ public String encrypt(String input) throws DataLengthException, */ public String decrypt(String cipher_text) throws DataLengthException, IllegalStateException, InvalidCipherTextException, IOException, IllegalArgumentException { - cipher_text = cipher_text.replace("\n", ""); + cipher_text +="\n"; byte[] cipher = Base64Encoder.decode(cipher_text); InputStream st = new ByteArrayInputStream(cipher); ByteArrayOutputStream ou = new ByteArrayOutputStream(); From 2ff0b1857a9558659255d4eef3e69421e5bb8618 Mon Sep 17 00:00:00 2001 From: Sachin Kumar Agrawal Date: Thu, 24 Dec 2015 19:16:46 +0530 Subject: [PATCH 2/2] Update PubnubCryptoCore.java --- java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java b/java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java index 56c2fe3fc..c40683103 100644 --- a/java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java +++ b/java/srcPubnubApi/com/pubnub/api/PubnubCryptoCore.java @@ -93,7 +93,7 @@ public String encrypt(String input) throws DataLengthException, */ public String decrypt(String cipher_text) throws DataLengthException, IllegalStateException, InvalidCipherTextException, IOException, IllegalArgumentException { - cipher_text +="\n"; + cipher_text ="\n" + cipher_text; byte[] cipher = Base64Encoder.decode(cipher_text); InputStream st = new ByteArrayInputStream(cipher); ByteArrayOutputStream ou = new ByteArrayOutputStream();