at async Promise.all (index 117) Decryption error details: InvalidCiphertextException: null #4646
Unanswered
ecumartesi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When i try decrypting my data using kms i get this error
Decryption error details: InvalidCiphertextException: null
This is my function, please help
export const decryptField = async (encryptedField) => {
if (!encryptedField) {
return null; // Handle empty or null fields appropriately
}
const decryptParams = {
CiphertextBlob: Buffer.from(encryptedField, "base64"),
};
try {
const { Plaintext } = await kms.decrypt(decryptParams).promise();
return Plaintext.toString("utf-8");
} catch (error) {
console.error("Decryption error details:", error);
throw new Error("Decryption error");
}
};
export const decryptData = async (encryptedData) => {
try {
const decryptedData = {};
console.log("Encrypted data to decrypt:", encryptedData);
} catch (error) {
console.error("Error decrypting data:", error);
throw new Error("Decryption error");
}
};
Beta Was this translation helpful? Give feedback.
All reactions