Navigation: Developing Apps > BINETIX® AGE™ API > Plugins > Cryptela™ > Functions
encrypt/2
Description
encrypt/2 is an Erlang function exported by "cryptela" module.
Commence data encryption with a symmetric key using the default cipher algorithm set by ?CRYPTELA_CIPHER_DEFAULT.
References
•gen_key/1
Parameters
Name
Type
Key
binary()
Symmetric key for data encryption.
Data
Input data buffer.
Result
Value or Type
On success returns an encrypted block of data.
Code Sample
> Key = cryptela:gen_key().
> cryptela:encrypt(Key, <<1,2,3>>).
<<3,133,172,205,38,94,179,155,35,14,80,154,229,212,48,100,32,3,3,0,0,0>>