edu.vt.middleware.crypt.pbe
Interface EncryptionScheme

All Known Implementing Classes:
AbstractEncryptionScheme, AbstractVariableKeySizeEncryptionScheme, OpenSSLEncryptionScheme, PBES1EncryptionScheme, PBES2EncryptionScheme, PKCS12EncryptionScheme

public interface EncryptionScheme

Describes a password-based encryption scheme.

Version:
$Revision: 1818 $
Author:
Middleware Services

Method Summary
 byte[] decrypt(char[] password, byte[] ciphertext)
          Decrypts the given ciphertext bytes into a byte array of plaintext using a decryption key based on the given password.
 void decrypt(char[] password, InputStream in, OutputStream out)
          Decrypts the data in the given ciphertext input stream into plaintext in the output stream.
 byte[] encrypt(char[] password, byte[] plaintext)
          Encrypts the given plaintext bytes into a byte array of ciphertext using an encryption key derived from the password.
 void encrypt(char[] password, InputStream in, OutputStream out)
          Encrypts the data in the given plaintext input stream into ciphertext in the output stream.
 

Method Detail

encrypt

byte[] encrypt(char[] password,
               byte[] plaintext)
               throws CryptException
Encrypts the given plaintext bytes into a byte array of ciphertext using an encryption key derived from the password.

Parameters:
password - Basis for encryption.
plaintext - Input plaintext bytes.
Returns:
Ciphertext resulting from plaintext encryption.
Throws:
CryptException - On encryption errors.

encrypt

void encrypt(char[] password,
             InputStream in,
             OutputStream out)
             throws CryptException,
                    IOException
Encrypts the data in the given plaintext input stream into ciphertext in the output stream. Use Base64FilterOutputStream or HexFilterOutputStream to produce ciphertext in the output stream in an encoded string repreprestation.

Parameters:
password - Basis for encryption.
in - Input stream of plaintext.
out - Output stream of ciphertext.
Throws:
CryptException - On encryption errors.
IOException - On stream read/write errors.

decrypt

byte[] decrypt(char[] password,
               byte[] ciphertext)
               throws CryptException
Decrypts the given ciphertext bytes into a byte array of plaintext using a decryption key based on the given password.

Parameters:
password - Basis for encryption.
ciphertext - Input ciphertext bytes.
Returns:
Plaintext resulting from ciphertext decryption.
Throws:
CryptException - On decryption errors.

decrypt

void decrypt(char[] password,
             InputStream in,
             OutputStream out)
             throws CryptException,
                    IOException
Decrypts the data in the given ciphertext input stream into plaintext in the output stream. Use Base64FilterInputStream or HexFilterInputStream to consume ciphertext in an encoded string representation.

Parameters:
password - Basis for encryption.
in - Input stream of ciphertext.
out - Output stream of plaintext.
Throws:
CryptException - On decryption errors.
IOException - On stream read/write errors.


Copyright © 2003-2011 Virginia Tech. All Rights Reserved.