| 113 | |
| 114 | // decryption |
| 115 | const decrypt = async encryptedData => { |
| 116 | try { |
| 117 | const plainText = await AesGcmCrypto.decrypt( |
| 118 | encryptedData['ciphertext'], |
| 119 | await getDataFromAsyncStorage('hashed_password'), |
| 120 | Buffer.from(encryptedData['nonce'], 'base64').toString('hex'), |
| 121 | Buffer.from(encryptedData['tag'], 'base64').toString('hex'), |
| 122 | false, |
| 123 | ); |
| 124 | return plainText; |
| 125 | } catch (e) { |
| 126 | throw new Error('Failed to decrypt: ' + e); |
| 127 | } |
| 128 | }; |
| 129 | |
| 130 | // hash clipboard content |
| 131 | const hashCB = async (input, seed = 0) => { |
no test coverage detected