MCPcopy
hub / github.com/Sathvik-Rao/ClipCascade / decrypt

Function decrypt

ClipCascade_Mobile/src/StartForegroundService.js:115–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) => {

Callers 2

onDataChannelMessageFunction · 0.85

Calls 3

getDataFromAsyncStorageFunction · 0.90
decryptMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected