mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-04 21:37:11 -04:00
parent
a07806cd15
commit
82d99b6965
5 changed files with 150 additions and 7 deletions
|
@ -46,6 +46,7 @@
|
|||
"@vueuse/core": "^10.3.0",
|
||||
"@vueuse/head": "^1.0.0",
|
||||
"@vueuse/router": "^10.0.0",
|
||||
"ansible-vault": "^1.1.1",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"change-case": "^4.1.2",
|
||||
"colord": "^2.9.3",
|
||||
|
|
25
pnpm-lock.yaml
generated
25
pnpm-lock.yaml
generated
|
@ -38,6 +38,9 @@ dependencies:
|
|||
'@vueuse/router':
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0(vue-router@4.1.6)(vue@3.3.4)
|
||||
ansible-vault:
|
||||
specifier: ^1.1.1
|
||||
version: 1.1.1
|
||||
bcryptjs:
|
||||
specifier: ^2.4.3
|
||||
version: 2.4.3
|
||||
|
@ -3341,7 +3344,7 @@ packages:
|
|||
dependencies:
|
||||
'@unhead/dom': 0.5.1
|
||||
'@unhead/schema': 0.5.1
|
||||
'@vueuse/shared': 10.7.2(vue@3.3.4)
|
||||
'@vueuse/shared': 10.9.0(vue@3.3.4)
|
||||
unhead: 0.5.1
|
||||
vue: 3.3.4
|
||||
transitivePeerDependencies:
|
||||
|
@ -3983,10 +3986,10 @@ packages:
|
|||
- vue
|
||||
dev: false
|
||||
|
||||
/@vueuse/shared@10.7.2(vue@3.3.4):
|
||||
resolution: {integrity: sha512-qFbXoxS44pi2FkgFjPvF4h7c9oMDutpyBdcJdMYIMg9XyXli2meFMuaKn+UMgsClo//Th6+beeCgqweT/79BVA==}
|
||||
/@vueuse/shared@10.9.0(vue@3.3.4):
|
||||
resolution: {integrity: sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==}
|
||||
dependencies:
|
||||
vue-demi: 0.14.6(vue@3.3.4)
|
||||
vue-demi: 0.14.7(vue@3.3.4)
|
||||
transitivePeerDependencies:
|
||||
- '@vue/composition-api'
|
||||
- vue
|
||||
|
@ -4085,6 +4088,12 @@ packages:
|
|||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
/ansible-vault@1.1.1:
|
||||
resolution: {integrity: sha512-JoUG/6poezcywvh0Fw5QJcrfwlmc5ZCSdZsYyHJkD6Qrby729jAoJ54mInTWg2pSDG+s2N09cp21A0Svzmo6+g==}
|
||||
dependencies:
|
||||
binascii: 0.0.2
|
||||
dev: false
|
||||
|
||||
/anymatch@3.1.3:
|
||||
resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
|
||||
engines: {node: '>= 8'}
|
||||
|
@ -4211,6 +4220,10 @@ packages:
|
|||
resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
/binascii@0.0.2:
|
||||
resolution: {integrity: sha512-rA2CrUl1+6yKrn+XgLs8Hdy18OER1UW146nM+ixzhQXDY+Bd3ySkyIJGwF2a4I45JwbvF1mDL/nWkqBwpOcdBA==}
|
||||
dev: false
|
||||
|
||||
/bl@4.1.0:
|
||||
resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
|
||||
dependencies:
|
||||
|
@ -9135,8 +9148,8 @@ packages:
|
|||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/vue-demi@0.14.6(vue@3.3.4):
|
||||
resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==}
|
||||
/vue-demi@0.14.7(vue@3.3.4):
|
||||
resolution: {integrity: sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
|
|
|
@ -0,0 +1,103 @@
|
|||
<script setup lang="ts">
|
||||
import { Vault } from 'ansible-vault';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const decryptedInput = ref('');
|
||||
const encryptPassword = ref('');
|
||||
const encryptId = ref('');
|
||||
const cryptedOutput = computedAsync(
|
||||
async () => {
|
||||
try {
|
||||
const v = new Vault({ password: encryptPassword.value });
|
||||
return await v.encrypt(decryptedInput.value, encryptId.value);
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const cryptedInput = ref('');
|
||||
const decryptPassword = ref('');
|
||||
const decryptedOutput = computedAsync(
|
||||
async () => {
|
||||
try {
|
||||
const v = new Vault({ password: decryptPassword.value });
|
||||
// handle mac \r
|
||||
return (await v.decrypt(cryptedInput.value?.replace(/\r(?!\n)/, '\n'), undefined)) ?? '';
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card title="Encrypt Ansible Vault Secret">
|
||||
<c-input-text
|
||||
v-model:value="decryptedInput"
|
||||
placeholder="Put your string to encrypt..."
|
||||
label="String to encrypt"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
|
||||
<n-space>
|
||||
<c-input-text
|
||||
v-model:value="encryptPassword"
|
||||
placeholder="Encryption password"
|
||||
label="Encryption password"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
<c-input-text
|
||||
v-model:value="encryptId"
|
||||
placeholder="Encryption Id"
|
||||
label="Encryption Id"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
</n-space>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<TextareaCopyable
|
||||
label="Encrypted string"
|
||||
:value="cryptedOutput"
|
||||
multiline
|
||||
readonly
|
||||
rows="5"
|
||||
mb-5
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Decrypt Ansible Vault Secret">
|
||||
<c-input-text
|
||||
v-model:value="cryptedInput"
|
||||
placeholder="Put your encrypted string here..."
|
||||
label="String to decrypt"
|
||||
raw-text multiline mb-5
|
||||
rows="5"
|
||||
/>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="decryptPassword"
|
||||
placeholder="Decryption password"
|
||||
label="Decryption password"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<TextareaCopyable
|
||||
label="Decrypted string"
|
||||
:value="decryptedOutput"
|
||||
multiline
|
||||
readonly
|
||||
rows="5"
|
||||
mb-5
|
||||
/>
|
||||
</c-card>
|
||||
</template>
|
12
src/tools/ansible-vault-crypt-decrypt/index.ts
Normal file
12
src/tools/ansible-vault-crypt-decrypt/index.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { LockSquare } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Ansible vault crypt decrypt',
|
||||
path: '/ansible-vault-crypt-decrypt',
|
||||
description: 'Encrypt and decrypt Ansible Vault Secrets',
|
||||
keywords: ['ansible', 'vault', 'crypt', 'decrypt'],
|
||||
component: () => import('./ansible-vault-crypt-decrypt.vue'),
|
||||
icon: LockSquare,
|
||||
createdAt: new Date('2024-02-25'),
|
||||
});
|
|
@ -2,6 +2,7 @@ import { tool as base64FileConverter } from './base64-file-converter';
|
|||
import { tool as base64StringConverter } from './base64-string-converter';
|
||||
import { tool as basicAuthGenerator } from './basic-auth-generator';
|
||||
import { tool as textToUnicode } from './text-to-unicode';
|
||||
import { tool as ansibleVaultCryptDecrypt } from './ansible-vault-crypt-decrypt';
|
||||
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
||||
import { tool as numeronymGenerator } from './numeronym-generator';
|
||||
import { tool as macAddressGenerator } from './mac-address-generator';
|
||||
|
@ -81,7 +82,20 @@ import { tool as yamlViewer } from './yaml-viewer';
|
|||
export const toolsByCategory: ToolCategory[] = [
|
||||
{
|
||||
name: 'Crypto',
|
||||
components: [tokenGenerator, hashText, bcrypt, uuidGenerator, ulidGenerator, cypher, bip39, hmacGenerator, rsaKeyPairGenerator, passwordStrengthAnalyser, pdfSignatureChecker],
|
||||
components: [
|
||||
tokenGenerator,
|
||||
hashText,
|
||||
bcrypt,
|
||||
uuidGenerator,
|
||||
ulidGenerator,
|
||||
cypher,
|
||||
bip39,
|
||||
hmacGenerator,
|
||||
rsaKeyPairGenerator,
|
||||
ansibleVaultCryptDecrypt,
|
||||
passwordStrengthAnalyser,
|
||||
pdfSignatureChecker,
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Converter',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue