Code examples for Cipher

Codota analyzed 7,668,838 open source code samples to find the most common, credible and clear examples.
You can now enable Codota on your own code to easily search and navigate your Java codebase.
145:	m_encryptCipher.init(Cipher.ENCRYPT_MODE, skeySpec, paramSpec); 
-
173:	m_encryptCipher.doFinal(input, dataOut); 
Full Snippet Info
7
CodeRank
113:	keyEncryptionCipher.init(Cipher.WRAP_MODE, publicKey, algParams, random); 
-
117:	keyEncryptionCipher.init(Cipher.WRAP_MODE, publicKey, random); 
-
119:	encryptedKeyBytes = keyEncryptionCipher.wrap(OperatorUtils.getJceKey(encryptionKey)); 
-
142:	keyEncryptionCipher.init(Cipher.ENCRYPT_MODE, publicKey, random); 
143:	encryptedKeyBytes = keyEncryptionCipher.doFinal(OperatorUtils.getJceKey(encryptionKey).getEncoded()); 
Full Snippet Info
7
CodeRank
90:	keyCipher.init(Cipher.UNWRAP_MODE, privKey, algParams); 
-
94:	keyCipher.init(Cipher.UNWRAP_MODE, privKey); 
-
96:	sKey = keyCipher.unwrap(encryptedKey, helper.getKeyAlgorithmName(encryptedKeyAlgorithm.getAlgorithm()), Cipher.SECRET_KEY); 
-
114:	keyCipher.init(Cipher.DECRYPT_MODE, privKey); 
115:	sKey = new SecretKeySpec(keyCipher.doFinal(encryptedKey), encryptedKeyAlgorithm.getAlgorithm().getId()); 
Full Snippet Info
7
CodeRank
171:	c1.init(Cipher.ENCRYPT_MODE, c1Key); 
-
173:	AlgorithmParameters param = c1.getParameters(); 
-
179:	byte[] out1 = c1.doFinal(message, 0, message.length); 
-
191:	int len1 = c1.doFinal(message, 0, message.length, out1, 0); 
-
213:	len1 = c1.update(message, 0, 2, out1, 0); 
-
215:	len1 += c1.doFinal(message, 2, message.length - 2, out1, len1); 
Full Snippet Info
7
CodeRank
52:	keyEncryptionCipher.init(Cipher.WRAP_MODE, new SecretKeySpec(derivedKey, keyEncryptionCipher.getAlgorithm()), ivSpec); 
-
54:	return keyEncryptionCipher.wrap(contentEncryptionKeySpec); 
Full Snippet Info
7
CodeRank
63:	keyEncryptionCipher.init(Cipher.UNWRAP_MODE, new SecretKeySpec(derivedKey, keyEncryptionCipher.getAlgorithm()), ivSpec); 
-
65:	return keyEncryptionCipher.unwrap(encryptedContentEncryptionKey, contentEncryptionAlgorithm.getAlgorithm().getId(), Cipher.SECRET_KEY); 
Full Snippet Info
7
CodeRank
111:	c.init(Cipher.ENCRYPT_MODE, sKey, new IvParameterSpec(new byte[c.getBlockSize()])); 
-
113:	return c.doFinal(sessionInfo, 0, sessionInfo.length); 
Full Snippet Info
7
CodeRank
134:	sCipher.init(Cipher.DECRYPT_MODE, sKeySpec); 
135:	return new String(sCipher.doFinal(passwordEn)); 
Full Snippet Info
6
CodeRank
52:	keyCipher.init(Cipher.UNWRAP_MODE, secretKey); 
-
54:	return new JceGenericKey(encryptedKeyAlgorithm, keyCipher.unwrap(encryptedKey, helper.getKeyAlgorithmName(encryptedKeyAlgorithm.getAlgorithm()), Cipher.SECRET_KEY)); 
Full Snippet Info
6
CodeRank
37:	expectedCihper.init(Cipher.ENCRYPT_MODE, key, new IvParameterSpec(new byte[expectedCihper.getBlockSize()])); 
-
39:	return cipher.doFinal(value); 
Full Snippet Info
6
CodeRank
58:	s_cipher.init(Cipher.ENCRYPT_MODE, s_key); 
59:	encString = s_cipher.doFinal(clearText.getBytes()); 
-
80:	s_cipher.init(Cipher.DECRYPT_MODE, s_key, s_cipher.getParameters()); 
81:	out = s_cipher.doFinal(decode); 
Full Snippet Info
6
CodeRank
110:	byte[] iv = new byte[c.getBlockSize()]; 
-
114:	c.init(Cipher.ENCRYPT_MODE, PGPUtil.makeSymmetricKey(encAlgorithm, keyBytes), new IvParameterSpec(iv)); 
Full Snippet Info
6
CodeRank
69:	keyEncryptionCipher.init(Cipher.WRAP_MODE, wrappingKey, random); 
-
71:	return keyEncryptionCipher.wrap(contentEncryptionKeySpec); 
Full Snippet Info
6
CodeRank
127:	this.outputCipher.init(Cipher.ENCRYPT_MODE, symKey, rand); 
-
146:	writeBlock(rsa.doFinal(this.outputCipher.getIV())); 
-
149:	writeBlock(this.outputCipher.doFinal(macKey.getEncoded())); 
Full Snippet Info
6
CodeRank
101:	cipher.init(Cipher.ENCRYPT_MODE, encKey, params, random); 
-
114:	params = cipher.getParameters(); 
Full Snippet Info
6
CodeRank
137:	keyCipher.init(Cipher.UNWRAP_MODE, agreedKey); 
138:	return keyCipher.unwrap(encryptedContentEncryptionKey, helper.getBaseCipherName(contentEncryptionAlgorithm), Cipher.SECRET_KEY); 
Full Snippet Info
6
CodeRank