API Docs for: 1.3.12
Show:

EcAesCtr Class

Encrypts data synchronously using AES-256-CTR. Requires secret and iv to be 32 bytes. Output is encoded in base64 for easier handling.

Item Index

Methods

Methods

decrypt

(
  • ciphertext
  • secret
  • iv
)
String static

Decrypts ciphertext using AES-256-CTR. Ciphertext must be base64 encoded ciphertext. Returns plaintext as a string (Sequence of bytes, no encoding).

Parameters:

  • ciphertext String

    Ciphertext to decrypt.

  • secret String

    Secret to use to decrypt.

  • iv String

    Initialization Vector to use to decrypt.

Returns:

String:

Plaintext with no encoding.

encrypt

(
  • plaintext
  • secret
  • iv
)
String static

Encrypts plaintext using AES-256-CTR. Plaintext is treated as as a sequence of bytes, does not perform UTF8 decoding. Returns base64 encoded ciphertext.

Parameters:

  • plaintext String

    Text to encrypt.

  • secret String

    Secret to use to encrypt.

  • iv String

    Initialization Vector to use to encrypt.

Returns:

String:

Ciphertext encoded using base64.