|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Role public interface PasswordCryptoService
Service allowing users to encrypt and decrypt text using a password.
| Method Summary | |
|---|---|
byte[] |
decryptBytes(byte[] rawCiphertext,
String password)
Decrypt raw ciphertext created with encryptBytes(byte[], String). |
String |
decryptText(String base64Ciphertext,
String password)
Decrypt a piece of text encrypted with encryptText. |
byte[] |
encryptBytes(byte[] message,
String password)
Encipher the given byte array with the password. |
String |
encryptText(String plaintext,
String password)
Encipher the given text with the password. |
boolean |
isPasswordCorrect(String password,
String protectedPassword)
Check the validity of a password. |
String |
protectPassword(String password)
Hash a password with a hash function specifically designed to make password guessing attacks difficult. |
| Method Detail |
|---|
String encryptText(String plaintext,
String password)
throws GeneralSecurityException
plaintext - the text to encrypt.password - which will be needed to decrypt the text.
GeneralSecurityException - if something goes wrong.
String decryptText(String base64Ciphertext,
String password)
throws GeneralSecurityException
base64Ciphertext - Base64 encoded ciphertext to decrypt.password - which was used to encrypt the text.
GeneralSecurityException - if something goes wrong.
byte[] encryptBytes(byte[] message,
String password)
throws GeneralSecurityException
message - the message to encrypt.password - which will be needed to decrypt the text.
decryptBytes(byte[], String)
GeneralSecurityException - if something goes wrong.
byte[] decryptBytes(byte[] rawCiphertext,
String password)
throws GeneralSecurityException
encryptBytes(byte[], String).
Most of the time the response is null if the password is incorrect, 1 out of 250 times the output is
unintelligable garbage.
rawCiphertext - the ciphertext to decrypt.password - which was used to encrypt the text.
GeneralSecurityException - if something goes wrong.
String protectPassword(String password)
throws GeneralSecurityException
password - the plain text user supplied password.
GeneralSecurityException - on errors
boolean isPasswordCorrect(String password,
String protectedPassword)
throws GeneralSecurityException
password - the plain text user supplied password.protectedPassword - the result from calling protectPassword.
GeneralSecurityException - on errors
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||