Skip to content

Missing aad parameter in Cipher.decryptString method. #216

@BirjuVachhani

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);
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions