Questions tagged [tink]

Tink is a multi-language, cross-platform library that provides a simple and misuse-proof API for common cryptographic tasks.

72 questions
11
votes
2 answers

Key construction in Tink for KeysetHandle

The following lines show how to generate a key in Tink: keysetHandle=KeysetHandle.generateNew(AeadKeyTemplates.AES128_GCM) privateKeysetHandle = KeysetHandle.generateNew(SignatureKeyTemplates.ECDSA_P256) Could you show me how to construct a key…
Ursa Major
  • 851
  • 7
  • 25
  • 47
9
votes
3 answers

How to easily encrypt and decrypt a String using Tink?

Until now, I was using jasypt to encrypt a string before storing it on disk on app closing, and later when opening the app for decrypt the string after retrieving it from disk. It was super easy with jasypt, this was the code: private static final…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
9
votes
4 answers

Google/Tink: How use public key to verify signature

We want to use the Tink library in our project to be able to verify some incoming signatures given a public key. What we have are the following: The public key as a string The signature itself The plaintext After going through Tink's…
Alex Ntousias
  • 8,962
  • 8
  • 39
  • 47
9
votes
1 answer

How to create symmetric encryption key with Google Tink?

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,…
Will P.
  • 101
  • 2
  • 4
6
votes
0 answers

Missing class com.google.errorprone.annotations.Immutable on building release apk with R8

I am getting below error on building the release apk with R8 enabled: Task :app:minifyReleaseWithR8 AGPBI: {"kind":"warning","text":"Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are…
Nitin Verma
  • 485
  • 4
  • 19
5
votes
0 answers

What does exception signify AndroidKeystoreAesGcm: encountered a potentially transient KeyStore error, will wait and retry

my current android application employs the tink library from google for encryption of data within my local database api 'com.google.crypto.tink:tink-android:1.6.1' my app gradle resembles this:- android { compileSdkVersion 32 buildToolsVersion…
Hector
  • 4,016
  • 21
  • 112
  • 211
4
votes
1 answer

Tink GeneralSecurityException: cannot find key template: AES128_GCM Tink

What I tried to run : KeysetHandle keyHandler = KeysetHandle.generateNew(KeyTemplates.get("AES128_GCM")); Error I got : java.security.GeneralSecurityException: cannot find key template: AES128_GCM at…
Ebenezer Isaac
  • 772
  • 1
  • 8
  • 31
4
votes
1 answer

Mutual TLS in Python using Google Cloud KMS

Is there a way to make HTTP requests over mTLS with private keys stored in Google Cloud Key Management Service? In this blog post what we need is done in Go. Is it possible to achieve the same in Python? I was hoping that Tink library provides some…
Fedor
  • 1,392
  • 1
  • 17
  • 30
4
votes
3 answers

Google Tink: How to get raw key string from a KeysetHandle?

I am new to Tink and would like to extract the raw key data(in String form) from KeysetHandle which I generated like this: keysetHandle = KeysetHandle.generateNew( AeadKeyTemplates.AES128_GCM); Or maybe some other API to get…
Manish Kumar Sharma
  • 12,982
  • 9
  • 58
  • 105
4
votes
1 answer

Android - NullPointerException in android.security.IKeystoreService.del for Huawei devices

When uploading our app to the Google Play store, google's pre-launch report indicates that the app is crashing with a null pointer exception. The issue is regarding KeyStore implementation in Huawei devices only. Stacktrace: Fatal Exception:…
Rajesh Jadav
  • 12,801
  • 5
  • 53
  • 78
4
votes
2 answers

Password encryption using google/tink

Good day, I have used google/tink to encrypt a password for storing in a DB using these steps : // 1. Generate the key material. KeysetHandle keysetHandle = KeysetHandle.generateNew(AeadKeyTemplates.AES128_GCM); // 2. Get the primitive. Aead…
Manish Mehta
  • 71
  • 3
  • 12
3
votes
2 answers

How to pass in valid values into cleartext_keyset_json to create a Tink key

In Tink, it is possible to load and write cleartext keysets as jsons. An non-working example is seen below: { "primaryKeyId": 2800579, "key": [ { "keyData": { "typeUrl": "type.googleapis.com/google.crypto.tink.AesGcmKey", …
user3776598
  • 436
  • 1
  • 5
  • 18
3
votes
0 answers

How to encrypt in a client side (Android) and decrypt in a server side (PHP) with "Tink"

I have used this demo for the Android side. In my case, I want to set this encrypt and decrypt process in the REST API. if someone has API through the reverse process(decompile) of Apk and call this API anyhow so I want to secure this process…
Pankaj Savaliya
  • 141
  • 1
  • 2
  • 11
2
votes
1 answer

Intermittently corrupted data with Google Tink encryption

Im investigating the use of com.google.crypto.tink:tink-android:1.6.1 in my current Android project. The data I am encrypting includes the OAuth2 Access Token/Refresh Token I employ for my remote API calls, e.g. Access Token is my Bearer token for…
Hector
  • 4,016
  • 21
  • 112
  • 211
2
votes
0 answers

AndroidKeysetManager Builder crash with HybridKeyTemplates

I've got Android code that encrypts/decrypts data. It was written over a year ago by another developer (who has since left) and has worked fine until very recently, when it started crashing with the following…
Aaron Hayman
  • 8,492
  • 2
  • 36
  • 63
1
2 3 4 5