Decrypting Secrets Returned by Zoho Vault API
Hello,
I've been able to follow the documentation here:
Zoho Vault | API Reference and successfully call the GET_LOGIN operation with my token. I get back a response containing/similar to this:
"name": "GET_LOGIN",
"details": {
"PASSPHRASE": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxABCDEFG==",
"SALT": "xxxxxxxxxxxxxxxxxxxxxxxxxx5423",
"ITERATION": 123456,
... etc.
There is a bit of documentation on using a passphrase, with javascript code:
var masterKey = null;
var passphrase = "user_passphrase"; if(LOGINTYPE == "PBKDF2_AES"){
var masterKey = Vault.PBKDF2_key(passphrase, SALT, ITERATION); }else{
var masterKey = Vault.hash(passphrase);
var passAuth = Vault.hash(passphrase+SALT); }
But, there is then no documentation or example on actually using this masterKey to decrypt a secret. From what I can gather online with PBKDF2 and AES, I need to use the masterKey to actually decrypt. But with AES, you also seem to need an initialization vector, or nonce (number used only once), and that is not mentioned at all.
My question is, what would an example decryption look like with the master key?