|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cipher
In cryptography, a cipher (or cypher) is an algorithm for encrypting or decrypting data. The encryption is the operation that converts information from plain text into code or cipher. The decryption is the operation that recovers information in plain text from a code or cipher. All implementation of a given cipher in Silverpeas must implement this interface.
When using a cipher the original information is known as plaintext, and the encrypted form as ciphertext. The ciphertext message contains all the information of the plaintext message, but is not in a format readable by a human or computer without the proper mechanism to decrypt it. The operation of a cipher usually depends on a piece of auxiliary information, called a key. A key must be selected before using a cipher to encrypt a message. Without knowledge of the key, it should be difficult, if not nearly impossible, to decrypt the resulting ciphertext into readable plaintext. ciphers can be categorized in several ways:
Method Summary | |
---|---|
String |
decrypt(byte[] encryptedData,
CipherKey keyCode)
Decrypt the specified code or cipher by using the specified cryptographic key. |
byte[] |
encrypt(String data,
CipherKey keyCode)
Encrypts the specified data by using the specified cryptographic key. |
CipherKey |
generateCipherKey()
Generates randomly a cipher key that can be used in the encryption and in the decryption of data with this cipher. |
CryptographicAlgorithmName |
getAlgorithmName()
Gets the name of the algorithm of the cipher. |
Method Detail |
---|
CryptographicAlgorithmName getAlgorithmName()
byte[] encrypt(String data, CipherKey keyCode) throws CryptoException
data
- the data to encode.keyCode
- the key to use in the encryption.
CryptoException
- if an error has occurred in the data encryption.String decrypt(byte[] encryptedData, CipherKey keyCode) throws CryptoException
encryptedData
- the data in bytes encrypted by this cipher.keyCode
- the key to use in the decryption.
CryptoException
- if an error has occurred in the data decryption.CipherKey generateCipherKey() throws CryptoException
CryptoException
- if an error has occurred in the key generation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |