1

当我执行下面的代码时,返回的字符串每次都不同。我可以配置一些东西以返回固定结果吗?

final AwsCrypto crypto = new AwsCrypto();
new String(Base64.getEncoder().encode(crypto.encryptData(masterKeyProvider, EXAMPLE_DATA).getResult()))
4

1 回答 1

1

在 SDK 中,AWS 已经添加了一些随机且无法删除的签名,因此加密的字符串不是恒定的。 https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/algorithms-reference.html

于 2020-09-11T08:30:41.483 回答