Skip to content

Missing aad parameter in Cipher.decryptString method. #216

Description

@BirjuVachhani

Cipher.decrypt method has aad parameter but Cipher.decryptString method doesn't.

Future<List<int>> decrypt(
    SecretBox secretBox, {
    required SecretKey secretKey,
    List<int> aad = const <int>[], // <-- parameter
    Uint8List? possibleBuffer,
  });

Missing:

Future<String> decryptString(
    SecretBox secretBox, {
    required SecretKey secretKey,
  }) async {
    final clearText = await decrypt(
      secretBox,
      secretKey: secretKey,
      // `aad` param can be passed here
    );
    try {
      return utf8.decode(clearText);
    } finally {
      // Don't leave possibly sensitive data in the heap.
      tryEraseBytes(clearText);
    }
  }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions