tink

How to create symmetric encryption key with Google Tink?

白昼怎懂夜的黑 提交于 2020-01-13 04:28:28
问题 I have a key (say) "thisist0psecret" that I want to use as a symmetric encryption/decryption key with the Google Tink library. I am baffled that I am unable to do this simple thing. I can generate new keys (using various templates AES128_GCM, etc.), serialize them and then read them back with KeysetReader. But, for the life of me, I cannot figure out how to create a symmetric key with the specific key bytes that I specify . I am able to do the following, for example, with Tink: KeysetHandle

How to create symmetric encryption key with Google Tink?

会有一股神秘感。 提交于 2020-01-13 04:28:12
问题 I have a key (say) "thisist0psecret" that I want to use as a symmetric encryption/decryption key with the Google Tink library. I am baffled that I am unable to do this simple thing. I can generate new keys (using various templates AES128_GCM, etc.), serialize them and then read them back with KeysetReader. But, for the life of me, I cannot figure out how to create a symmetric key with the specific key bytes that I specify . I am able to do the following, for example, with Tink: KeysetHandle

Decryption result not consistent

和自甴很熟 提交于 2019-12-25 00:15:06
问题 I have two instances of my service that does the encryption and decryption running in cloud. The decryption fails sometimes with 'decryption failed' error. I guess this is because each instance has its own Aead instance. How can i solve this issue? public class Utils { private static final Logger log = LoggerFactory.getLogger(Utils.class); private Aead aead; private static Utils utils; private Utils() { try { AeadConfig.register(); KeysetHandle keysetHandle = KeysetHandle.generateNew