|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.monica.javacom.ciphering.AES
Implements an AES (American Encription Standard, also known as RC6) encoder/decoder, which is the recent standard for symmetric-key-ciphering of digital data. This object uses an AESKey as the encoding/decoding key, generated by an AESKeyGenerator. As the main functionality, the coder gets a String which contains the initial data, and returns the coded representation of this String.
AESKey
,
AESKeyGenerator
Constructor Summary | |
AES(AESKey in_key,
int in_numberOfRounds)
Constructs a new AES encoder/decoder object. |
Method Summary | |
java.lang.String |
decode(java.lang.String text)
Decodes the specified String. |
java.lang.String |
encode(java.lang.String text)
Encodes the specified String. |
AESKey |
getKey()
Returns the AESKey of this AES object. |
int |
getNumberOfRounds()
Returns the number of rounds of this AES object. |
void |
setKey(AESKey in_key)
Sets the AESKey of this object. |
void |
setNumberOfRounds(int in_numberOfRounds)
Sets the number of rounds of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AES(AESKey in_key, int in_numberOfRounds) throws BadInputValueException
in_key
- the AESKey that the AES will use to encode/decodein_numberOfRounds
- the number of runds defined in the AES algorithm - default: 20BadInputValueException
- the in_numberOfRounds parameter must be between 1 and 256Method Detail |
public java.lang.String encode(java.lang.String text) throws ZeroLengthStringException
text
- the input text which has to be encodedZeroLengthStringException
- input string must not be emptypublic java.lang.String decode(java.lang.String text) throws ZeroLengthStringException
text
- the encoded text which must be the result of the encode() function of an AES object whith the same key, that this AES is working with.ZeroLengthStringException
- input string must not be empty and the length of it must be a multiple of 17public AESKey getKey()
public int getNumberOfRounds()
public void setKey(AESKey in_key)
in_key
- the new AESKey that this AES object should usepublic void setNumberOfRounds(int in_numberOfRounds) throws BadInputValueException
in_numberOfRounds
- the number of runds defined in the AES algorithmBadInputValueException
- the in_numberOfRounds parameter must be between 1 and 256
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |