Class Cipher
java.lang.Object
es.kukenan.smartfi.microservice.contracts.service.security.Cipher
Component used to cypher sensible information stored in unsecured media.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
CHARSET
Charset to use to get buffer from configuration. -
seed
private final byte[] seedThe key material of the secret key. -
uuid
private final byte[] uuidThe buffer with the IV. -
algorithm
Cipher algorithm.
-
-
Constructor Details
-
Cipher
Cipher constructor.- Parameters:
seed- a string the key material of the secret key.uuid- a string with the buffer with the IV.
-
-
Method Details
-
encrypt
Encrypts the given text using the configured cipher specification.- Parameters:
hash- the text to encrypt.- Returns:
- encrypted text, in base 64 format.
-
decrypt
Decrypts the given text using the configured cipher specification.- Parameters:
hash- the data to decrypt, in Base64 format.- Returns:
- encrypted text.
-