This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use client"; | |
import * as React from "react"; | |
import { Input } from "@/components/ui/Input"; | |
import { Button } from "@/components/ui/Button"; | |
import { | |
AlertDialog, | |
AlertDialogContent, | |
AlertDialogHeader, | |
AlertDialogTitle, | |
AlertDialogDescription, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function aesEncrypt(data, password, difficulty = 10) { | |
const hashKey = await grindKey(password, difficulty) | |
const iv = await getIv(password, data) | |
const key = await window.crypto.subtle.importKey( | |
'raw', | |
hashKey, { | |
name: 'AES-GCM', | |
}, | |
false, |