/** * Overwrite the salt (pepper) if it * is secret and no longer used (zeroization) */ public void clearSalt() { if (salt != null) { Arrays.fill(salt, (byte)0); } } }
private static byte[][] genSSL3Const() { int n = 10; byte[][] arr = new byte[n][]; for (int i = 0; i < n; i++) { byte[] b = new byte[i + 1]; Arrays.fill(b, (byte)('A' + i)); arr[i] = b; } return arr; }
public void clear() { if (this.masterSecret != null) { Arrays.fill(this.masterSecret, (byte)0); } }
private static void Clear(int[] array) { if (array != null) { Arrays.fill(array, 0); } }
private static byte[] genPad(byte b, int count) { byte[] padding = new byte[count]; Arrays.fill(padding, b); return padding; } }
public synchronized void destroy() { if (data != null) { // TODO Is there a way to ensure the data is really overwritten? Arrays.fill(data, (byte)0); this.data = null; } }
/** * reset the chaining vector back to the IV and reset the underlying * cipher. */ public void reset() { System.arraycopy(IV, 0, cfbV, 0, IV.length); Arrays.fill(inBuf, (byte)0); byteCount = 0; cipher.reset(); } }
/** * reset the chaining vector back to the IV and reset the underlying * cipher. */ public void reset() { System.arraycopy(IV, 0, cbcV, 0, IV.length); Arrays.fill(cbcNextV, (byte)0); cipher.reset(); }
protected byte[] engineGenerateSecret() throws IllegalStateException { byte[] rv = Arrays.clone(shared); Arrays.fill(shared, (byte)0); return rv; }
/** * reset the chaining vector back to the IV and reset the underlying * cipher. */ public void reset() { System.arraycopy(IV, 0, cbcV, 0, IV.length); Arrays.fill(cbcNextV, (byte)0); cipher.reset(); }
public byte[] generatePremasterSecret() throws IOException { byte[] other_secret = generateOtherSecret(psk.length); ByteArrayOutputStream buf = new ByteArrayOutputStream(4 + other_secret.length + psk.length); TlsUtils.writeOpaque16(other_secret, buf); TlsUtils.writeOpaque16(psk, buf); Arrays.fill(psk, (byte)0); this.psk = null; return buf.toByteArray(); }
protected KeyParameter generateRecordMACKey(StreamCipher cipher) { byte[] firstBlock = new byte[64]; cipher.processBytes(firstBlock, 0, firstBlock.length, firstBlock, 0); KeyParameter macKey = new KeyParameter(firstBlock, 0, 32); Arrays.fill(firstBlock, (byte)0); return macKey; }
private static void updateMac(Mac mac, BigInteger bigInteger) { byte[] byteArray = BigIntegers.asUnsignedByteArray(bigInteger); mac.update(byteArray, 0, byteArray.length); Arrays.fill(byteArray, (byte)0); }
private void processFilledBuffer(byte[] in, int inOff) { // copies into the block... for (int i = 0; i < _state.length; i++) { _block[i] = bytesToLongFromBuffer(_buffer, i * 8); } processBlock(); _bufferPos = 0; Arrays.fill(_buffer, (byte)0); }
private static void updateDigest(Digest digest, String string) { byte[] byteArray = Strings.toUTF8ByteArray(string); digest.update(byteArray, 0, byteArray.length); Arrays.fill(byteArray, (byte)0); }
private static void updateMac(Mac mac, String string) { byte[] byteArray = Strings.toUTF8ByteArray(string); mac.update(byteArray, 0, byteArray.length); Arrays.fill(byteArray, (byte)0); }
private static void updateDigestIncludingSize(Digest digest, BigInteger bigInteger) { byte[] byteArray = BigIntegers.asUnsignedByteArray(bigInteger); digest.update(intToByteArray(byteArray.length), 0, 4); digest.update(byteArray, 0, byteArray.length); Arrays.fill(byteArray, (byte)0); }
private static void updateDigestIncludingSize(Digest digest, String string) { byte[] byteArray = Strings.toUTF8ByteArray(string); digest.update(intToByteArray(byteArray.length), 0, 4); digest.update(byteArray, 0, byteArray.length); Arrays.fill(byteArray, (byte)0); }