mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 16:16:55 +00:00
IV를 암호화된 파일 및 썸네일 앞에 합쳐서 전송하도록 변경
This commit is contained in:
@@ -89,11 +89,15 @@ export const encryptData = async (data: BufferSource, dataKey: CryptoKey) => {
|
||||
return { ciphertext, iv: encodeToBase64(iv.buffer) };
|
||||
};
|
||||
|
||||
export const decryptData = async (ciphertext: BufferSource, iv: string, dataKey: CryptoKey) => {
|
||||
export const decryptData = async (
|
||||
ciphertext: BufferSource,
|
||||
iv: string | BufferSource,
|
||||
dataKey: CryptoKey,
|
||||
) => {
|
||||
return await window.crypto.subtle.decrypt(
|
||||
{
|
||||
name: "AES-GCM",
|
||||
iv: decodeFromBase64(iv),
|
||||
iv: typeof iv === "string" ? decodeFromBase64(iv) : iv,
|
||||
} satisfies AesGcmParams,
|
||||
dataKey,
|
||||
ciphertext,
|
||||
|
||||
Reference in New Issue
Block a user