Decrypt

Returns

Decrypt content with the account the content was encrypted for. This will return the decrypted content.

Usage

import { encryption } from 'aleph-js'

await encryption.decrypt(account, content)

// Or with optional parameters
await encryption.decrypt(account, content, {as_hex: true, as_string: true})

Required parameters

Optional parameters

In addition to the required parameters above, an object of optional parameters can be passed following the content like so:

encryption.decrypt(account, content,{as_hex: false})

  • as_hex - boolean

    Default: true

    Should be set to true to decrypt content that was a hexadecimal representation of the object.

  • as_string - boolean

    Default: true

    Should be set to true if the content to decrypt is a string. If as_hex is set to true, as_string will be ignored.

Example

DECRYPT REQUEST
await aleph.encryption.decrypt(account, '04465d5bbda5a1255fc19d494bfa8035b8a210ac96a0cdc8787d684048e1c879a06f107885ccec8b12350499fcad124a4adf3bbe4de125e55aac6359402e8db8b210241fbe86a785208995a26e913bcd3d23970a0a04872893a575be11dc87dde2a811d0183e86df3ea58ef66041b89e2ac7fa')
RESPONSE
'content to encrypt'

Last updated