diff --git a/src/main/java/com/crypto/codec/Base64.java b/src/main/java/com/crypto/codec/Base64.java index 9d1ff91c..f65faf96 100644 --- a/src/main/java/com/crypto/codec/Base64.java +++ b/src/main/java/com/crypto/codec/Base64.java @@ -184,7 +184,7 @@ public class Base64 { decodedBlock[0] = (byte) (decodeAlphabet[block[0]] << 2 | decodeAlphabet[block[1]] >>> 4); decodedBlock[1] = (byte) (decodeAlphabet[block[1]] << 4 | decodeAlphabet[block[2]] >>> 2); - decodedBlock[2] = (byte) (decodeAlphabet[block[2]] << 6 | decodeAlphabet[block[3]]); + decodedBlock[2] = (byte) (decodeAlphabet[block[2]] << 6 | decodeAlphabet[block[3]] & 0xff); return decodedBlock; }