diff options
author | 2023-05-28 23:13:24 +0200 | |
---|---|---|
committer | 2023-05-28 23:29:14 +0200 | |
commit | 33c9b6643f58a6930043f460d5bfdca4bc1f7222 (patch) | |
tree | f313935e30f7b90ea16e564e7171e2e72319ce29 /src/tools/encryption/encryption.vue | |
parent | 4d2b037dbe4e78aa90a4a6d9c7315dcf0a51fed9 (diff) | |
download | it-tools-33c9b6643f58a6930043f460d5bfdca4bc1f7222.tar.gz it-tools-33c9b6643f58a6930043f460d5bfdca4bc1f7222.tar.zst it-tools-33c9b6643f58a6930043f460d5bfdca4bc1f7222.zip |
chore(lint): switched to a better lint config
Diffstat (limited to 'src/tools/encryption/encryption.vue')
-rw-r--r-- | src/tools/encryption/encryption.vue | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/tools/encryption/encryption.vue b/src/tools/encryption/encryption.vue index 4da451c..d738509 100644 --- a/src/tools/encryption/encryption.vue +++ b/src/tools/encryption/encryption.vue @@ -1,3 +1,22 @@ +<script setup lang="ts"> +import { computed, ref } from 'vue'; +import { AES, RC4, Rabbit, TripleDES, enc } from 'crypto-js'; + +const algos = { AES, TripleDES, Rabbit, RC4 }; + +const cypherInput = ref('Lorem ipsum dolor sit amet'); +const cypherAlgo = ref<keyof typeof algos>('AES'); +const cypherSecret = ref('my secret key'); +const cypherOutput = computed(() => algos[cypherAlgo.value].encrypt(cypherInput.value, cypherSecret.value).toString()); + +const decryptInput = ref('U2FsdGVkX1/EC3+6P5dbbkZ3e1kQ5o2yzuU0NHTjmrKnLBEwreV489Kr0DIB+uBs'); +const decryptAlgo = ref<keyof typeof algos>('AES'); +const decryptSecret = ref('my secret key'); +const decryptOutput = computed(() => + algos[decryptAlgo.value].decrypt(decryptInput.value, decryptSecret.value).toString(enc.Utf8), +); +</script> + <template> <c-card title="Encrypt"> <div flex gap-3> @@ -78,22 +97,3 @@ </n-form-item> </c-card> </template> - -<script setup lang="ts"> -import { computed, ref } from 'vue'; -import { AES, TripleDES, Rabbit, RC4, enc } from 'crypto-js'; - -const algos = { AES, TripleDES, Rabbit, RC4 }; - -const cypherInput = ref('Lorem ipsum dolor sit amet'); -const cypherAlgo = ref<keyof typeof algos>('AES'); -const cypherSecret = ref('my secret key'); -const cypherOutput = computed(() => algos[cypherAlgo.value].encrypt(cypherInput.value, cypherSecret.value).toString()); - -const decryptInput = ref('U2FsdGVkX1/EC3+6P5dbbkZ3e1kQ5o2yzuU0NHTjmrKnLBEwreV489Kr0DIB+uBs'); -const decryptAlgo = ref<keyof typeof algos>('AES'); -const decryptSecret = ref('my secret key'); -const decryptOutput = computed(() => - algos[decryptAlgo.value].decrypt(decryptInput.value, decryptSecret.value).toString(enc.Utf8), -); -</script> |