Questions tagged [tink]
Tink is a multi-language, cross-platform library that provides a simple and misuse-proof API for common cryptographic tasks.
64
questions
0
votes
0
answers
21
views
When trying to make an API call i get the error,"errorMessage" : "No recognized authentication method was provided."
I am tyring to make an api call to trade a code for an api access token using a client id and client secret to call the TinkOAuthApi. This was supposed to return an api access token to get a ...
0
votes
0
answers
14
views
Google Tink - Registering keyset: Should I do it once on the start up of Server or each time I'm generating a key
I'm using Google Tink for encryption across network calls and wondering about when the proper time is to register my keyset. AeadConfig.register()
Since this is a backend application, is it correct ...
0
votes
1
answer
66
views
How to get string representation of Key from KeySetHandle/KeyTemplate in Google Tink
Here is my code
KeysetHandle handle = KeysetHandle.generateNew(KeyTemplates.get("AES256_GCM"));
Aead aead = handle.getPrimitive(Aead.class);
How can I get the byte /string representation of ...
0
votes
1
answer
478
views
AES-256-CTR decryption in Golang
I have difficulties to decrypt payload with AES-256-CTR in Golang
Format:
A zero IV.
Not padded.
Input:
func main() {
encryptedKey := []byte{196, 231, 38, 149, 234, 51, 142, 186, 230, 214, 96, 243, ...
0
votes
0
answers
143
views
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:-
...
1
vote
1
answer
267
views
GCP Cloud KMS - custom key, disaster recovery possible?
we are currently getting our heads around gcp cloud kms and how to cater for disaster recovery. this is our current test setup:
Java using Spring boot + Google Tink using KMSEnvelopeAead + AesGcmJce (...
0
votes
0
answers
50
views
Using tink key in another library AES-256 GCM
I am trying to implement a application for a company. In application side we use google tink. However for server side they want to use their own library. What I need is extracting key created by ...
0
votes
1
answer
123
views
java: incompatible types: T cannot be converted to java.lang.String
I am currently working on a encryption and decryption service for my application, using Google Tink.
The problem is the following: I want to program it without using (nearly) duplicate code and ...
0
votes
1
answer
214
views
How to keep backup of Android Keystore's master key or create from user input?
I am using Google/Tink's Deterministic symmetric key encryption in my project. Like this-
byte[] ciphertext;
Context context = getApplicationContext();
String plainText="Hello World";...
4
votes
1
answer
734
views
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 ...
0
votes
0
answers
125
views
How to convert Google Tink KeysetHandle to byte[ ] and back?
I'm trying to convert Google Tink's KeysetHandle into byte [] and to construct the KeysetHandle back from the byte [].
So here is the code I came up with
//Two functions for the conversion
public ...
0
votes
1
answer
127
views
How to do this in Tink's Objective-c?
It seems so much simpler to encrypt using java than obj-c with Tink. Given a known 32-bytes XChaCha20Poly1305 key, and a 16-bytes authenticated data (aad), how can the same be done in objective-c?
...
0
votes
0
answers
202
views
google tink got "referenceerror: self is not defined" when using in Nodejs
We are trying to use google tink and below is a sample that how we use it.
const tinkLoader = () => import("tink-crypto");
tinkLoader().then((tink) => {
tink.hybrid....
2
votes
1
answer
325
views
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 ...
0
votes
1
answer
205
views
How to read from a secure websocket with Tink in C++
I'm working on a C++ client app that needs to read from a secure websocket. After looking into some websocket libraries I would like to use easywsclient but it does not support TLS. I tried adding ...
0
votes
0
answers
80
views
Can you configure com.google.crypto.tink to use androidx.datastore instead of Shared Prefs
My current Android application is investigating the use of crypto library com.google.crypto.tink
com.google.crypto.tink.integration.android.AndroidKeysetManager Builder uses sharedPrefs as shown below
...
3
votes
1
answer
395
views
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: ...
2
votes
0
answers
67
views
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 ...
2
votes
2
answers
308
views
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": ...
1
vote
0
answers
199
views
Decrypt Google Pay payment token using Go
I want to implement the decryption of Google Pay payment tokens using the Go language. Google strongly recommends using the Tink library.
I have looked at the instructions provided here, but couldn't ...
0
votes
1
answer
269
views
How to build Google tink library using bazel in C++?
I want to use Google tink library for my app. I bound my code using android ndk. However, I couldn't build Google tink library with bazel. I have tried their examples on github (https://github.com/...
0
votes
1
answer
172
views
Google Tink Hybrid params
Google Tink supports "hybrid encryption" - a convenience method of encrypting a symmetric key with an asymmetric one, encrypting a plaintext with the symmetric key, and bundling the two ...
2
votes
1
answer
424
views
Export keyset entry from Tink with AndroidKeysetManager
I'm using 'androidx.security:security-crypto:1.1.0-alpha02' in an android project. It works fine for file encryption/decription. I've set up a master key inside the hardware keystore that requires ...
0
votes
1
answer
486
views
How to rotate keys?
I'm looking at the Tink documentation, but I don't see a clear way how to rotate a key. Basically, I would like to do somethink like:
KeyTemplate keyTemplate = AeadKeyTemplates.AES256_GCM;
...
0
votes
1
answer
355
views
How to generate a Java tink key?
I'm using the Google Tink library in my Java project to encrypt two texts, one with Symmetric Key Encryption (SKE), and another one with Deterministic symmetric key encryption (DSKE).
This is a ...
1
vote
0
answers
178
views
Google Tink Key management and sharing from android to .NET to decrypt data to server end which is encrypted at mobile(client) end
I am trying to make an end to end encrypted app where I encrypt data at the mobile end at the time of sending and we can decrypt it at the server(for user info). but I am not able to find any solution ...
3
votes
1
answer
355
views
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 ...
-2
votes
2
answers
1k
views
Android Studio : Gradle sync failed: Could not download tink
When start a project on Android Studio 4.0, Gradle cannot sync completely and Design mode is unavailable. Error message appear - > Gradle sync failed: Could not download tink-1.3.0-rc2.jar (com.google....
0
votes
1
answer
161
views
Can I decrypt data which is encrypted by Keyczar using Google Tink?
I have been using Google Keyczar for encrypting data in my JAVA app. And I want to change the crypto solution to Google Tink.
But the problem is the already encrypted data by Keyczar. Can I decrypt ...
-1
votes
1
answer
115
views
DeterministicAead one key but change initialization vector?
I'm using Googles Tink DeterministicAead. What I'd like to achieve, is to use the same key over a long time, but change the ciphertext for a certain plaintext every 24 hours (for GDPR reasons).
Can I ...
2
votes
2
answers
1k
views
Issue decrypting a file encrypted with EncryptedFile on Android
I am encrypting a file created on the android app in a Bluetooth service. In another class later on I want to decrypt this file and upload it to a server.
For encryption I am using the AndroidX ...
1
vote
1
answer
178
views
Google TINK - Streaming AEAD Always returning an output file of 1 KB
I am trying to encrypt a file(txt, pdf, doc) using Google Tink - streaming AEAD encryption, below is the Java code which I am trying to execute. But all I get is 1 KB output encrypted file and no ...
1
vote
0
answers
418
views
Implementing envelope encryption on Android using Tink and Google Cloud KMS
The app I am implementing will contains highly sensitive user data and as such we want to encrypt the data before saving it, both locally and online (on Gcloud Firestore). I'd like to do this using ...
1
vote
1
answer
497
views
Google Pay PaymentMethodTokenRecipient function implementation in Golang
I am trying to implement Google Pay decryption method as mentioned.
https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#decrypt-token
It mentions to use tink ...
0
votes
1
answer
838
views
Admob rewarded ads server side verification
I wanted to do server-side validation for Admob rewarded video ads on my android app. For this, I followed the instructions in the admob documentation but failed.
First I imported the google tink ...
1
vote
2
answers
1k
views
Decryption erorr when using tink in Java
I am trying to create an encrypted token that is to be sent as an REST API response. The end user then can send the same token during next request to this api, and I can parse it and get some context ...
0
votes
1
answer
51
views
Are Google Tink ciphertexts portable across programming languages?
I am wondering if I encrypt a plaintext, let's say using the Go SDK whether I will be able to decrypt it using the Java SDK? Is that a design goal of the library to guarantee this portability across ...
1
vote
1
answer
766
views
How to create master key in Tink android
I wanted to use Tink library and able to encrypt and decrypt data but not understanding what is the purpose of master key in its creation and how to create a master key for it.
private fun ...
2
votes
1
answer
1k
views
How Do I manage Android Keystore KMS for symmetric encryption and decryption?
I want to encrypt and decrypt with symmetrically with android Keystore KMS. I'm aware with Google cloud KMS, and AWS KMS, but I don't want to handle with that platform.
How to manage this generated ...
3
votes
0
answers
89
views
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 ...
11
votes
2
answers
1k
views
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....
-1
votes
1
answer
381
views
AdMob Server Side Validation for Video Reward
I need to verify the video reward of a user on the server, I'm using Google's Admob and as the documentation found on their website I can't find anything that could help me doing that kind of stuff, ...
0
votes
2
answers
205
views
Decryption result not consistent
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 ...
0
votes
3
answers
3k
views
Tag Mismatch error when decrypting the key using google tink library
I am new to cryptography. I am working on a poc to encrypt and decrypt a string. When I decrypt the encrypted string it works sometimes but other times throws Tag mismatch error. Am I missing ...
1
vote
1
answer
635
views
Decryption failed after registering AeadConfig more than once?
I'm encrypting some text and trying to decrypt it, however it's failing to decrypt when I am using a different AeadConfig.register() to decrypt than to encrypt. I'm wondering how to resolve this ...
8
votes
3
answers
9k
views
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 ...
1
vote
1
answer
84
views
Using Symmetric keys in Tink
I am trying to store cleartext password in properties file and load that JSON using CleartextKeysetHandle.read
However, when I want to rotate the key, I would like to introduce another key which is ...
1
vote
1
answer
283
views
How to generate a Tink key from a user-provided password
I want to store a keyset, and would like the file to be encrypted with key produced from a user-provided "master password". And of course, at a later point I'd like to, given the same master password, ...
0
votes
2
answers
394
views
google-cloud-kms PKCS7 Cryptographic Message Syntax
Has anyone implemented Cryptographic Message Syntax using Google's HSM and KMS service?
It is difficult to tell if this functionality is built into the Tinklibrary or not.
There is no Google Engine ...
1
vote
1
answer
808
views
Multiple private/public Key pairs in Tink
I started exploring "Tink" recently and now stuck at a particular problem, and couldn't find the solution in docs or online.
The case is: I want to have two sets of Public/Private keypairs. One ...