HomePhabricator
Diffusion Comm fc7383f60b2e

[native][AES] Implement encrypt function on Android

Description

[native][AES] Implement encrypt function on Android

Summary:
Counterpart of D7005 for Android. More context in that diff.

Docs: https://developer.android.com/reference/kotlin/javax/crypto/Cipher
Inspired by: https://levelup.gitconnected.com/doing-aes-gcm-in-android-adventures-in-the-field-72617401269d

Depends on D7006

Test Plan:
The same as in D7005:

import * as AES from './utils/aes-crypto-module.js';

const key = AES.generateKey();
const plaintextBytes = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
const ciphertext = AES.encrypt(key, plaintextBytes);
console.log('Ciphertext', ciphertext);
// ensured that ciphertext is 12+10+16=38 bytes long (ciphertext.length==38)

Reviewers: marcin, atul, varun

Reviewed By: atul

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D7007

Details

Provenance
bartekAuthored on Mar 8 2023, 6:31 AM
Reviewer
atul
Differential Revision
D7007: [native][AES] Implement encrypt function on Android
Parents
rCOMM868e5fda92f6: [native][AES] Implement decrypt function on iOS
Branches
Unknown
Tags
Unknown