I don't want padding here..
Post
Replies
Boosts
Views
Activity
No, I don't want padding. I have done the same with Ruby, Java, Go, and others and none require padding or the input value to be a multiple of 16 bytes like the Swift library seems to require.
const key = '12345678901234567890123456789012';
const iv = '000000000000'
const cipher = crypto.createCipheriv('aes-256-gcm', key, iv);	
const plaintext = 'Hello';	
const ciphertext = cipher.update(plaintext, 'utf8');	
console.log("ciphertext length %d", ciphertext.length)	
cipher.final();	
const tag = cipher.getAuthTag();
const decipher = crypto.createDecipheriv('aes-256-gcm', key, iv);	
decipher.setAuthTag(tag);	
const receivedPlaintext = decipher.update(ciphertext, null, 'utf8');	
try {
	decipher.final();
} catch (err) {
	console.error('Authentication failed!');
	return;
}
console.log(receivedPlaintext);
Hi, I am facing same issue, is there any solution to resolve this, I am using swift package manager.
Thanks in advance.