Vue composable for symmetric encryption/decryption using secretbox (XChaCha20-Poly1305).
If the CryptoPlugin has been installed with a defaultKey, that key is used when none is passed explicitly.
defaultKey
<script setup lang="ts">const { encrypt, randomKey, ciphertext } = useEncrypt();const key = randomKey();await encrypt(key, "secret message");</script> Copy
<script setup lang="ts">const { encrypt, randomKey, ciphertext } = useEncrypt();const key = randomKey();await encrypt(key, "secret message");</script>
Vue composable for symmetric encryption/decryption using secretbox (XChaCha20-Poly1305).
If the CryptoPlugin has been installed with a
defaultKey, that key is used when none is passed explicitly.