org.logi.crypto.padding
Interface Padding
- All Known Implementing Classes:
- PadZero, PadPKCS5, PadNone, PadPKCS1v15
- public interface Padding
Classes implementing this interface implement a padding scheme such as
PKCS#5.
- Author:
- Logi Ragnarsson
(logir@logi.org)
- See Also:
Crypto.fromString(String)
|
Method Summary |
byte[] |
pad(byte[] plaintext,
int off,
int len,
EncryptionKey key)
Pad the last, perhaps partial, block of plaintext. |
byte[] |
unPad(byte[] plaintext,
int off,
int len,
DecryptionKey key)
Un-pad the last block of plaintext. |
pad
public byte[] pad(byte[] plaintext,
int off,
int len,
EncryptionKey key)
throws PaddingException
- Pad the last, perhaps partial, block of plaintext.
- Parameters:
plaintext - The array holding plaintext data to pad.off - The offset of data within plaintext array.len - The length of data within plaintext array. This much be less
than a single plaintext block.key - The key which will be used to encrypt the block.
unPad
public byte[] unPad(byte[] plaintext,
int off,
int len,
DecryptionKey key)
throws PaddingException
- Un-pad the last block of plaintext.
- Parameters:
padded - The array holding padded plaintext data.off - The offset of data within padded array.len - The length of data within padded array.key - The key which will be used to decrypt the block.
Copyright (c) 1997-2001 Logi Ragnarsson - Distributed under the GPL