ImportKeyMaterial request failed - InvalidCiphertextException

0

Hi,

I have encrypted a symmetric key by the downloaded wrappingKey, then upload the encrypted symmetric key with the importToken. Then it returns the error: ImportKeyMaterial request failed - InvalidCiphertextException.

After having some research in the internet, it is suggested to use "openssl rand -out symmetric.key 32", but the symmetric key I generated is using "openssl rand -base64 32 > symmetric.key; openssl rand -base64 16 >> symmetric.key". I can successfully import the key generated by the suggested command. Below is my enquiry

  1. is it not possible for me to upload a key generated by "openssl rand -base64 32 > symmetric.key; openssl rand -base64 16 >> symmetric.key"?
  2. Is there any guideline on symmetric key generation?

Thanks and Regards, KTMo

질문됨 2년 전1097회 조회
1개 답변
0

Hi,

I understand that you are receiving an error ”InvalidCiphertextException” when trying to import a key generated from the command “openssl rand -base64 32 > symmetric.key; openssl rand -base64 16 >> symmetric.key” .

In regards to your first question this would not be possible to use the command listed. You would need to ensure that the key material is a 256-bit symmetric key and the file size of the encrypted key material is 32 bytes. I am attaching the following documentation that goes over the error here (1).

For a guideline on symmetric key generation I am attaching the following documentation that has a step by step walk-through of how to create and import key material in AWS KMS (2). Lastly I am attaching the following that goes over the certain considerations when deciding to import key material into AWS KMS (3).

Let us know if you need any further information! I hope you have a great rest of your day!

References

(1) https://aws.amazon.com/premiumsupport/knowledge-center/invalidciphertext-kms/

(2) https://aws.amazon.com/premiumsupport/knowledge-center/import-keys-kms/

(3) https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#importing-keys-considerations

AWS
지원 엔지니어
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠