mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-28 16:19:48 +03:00
1 parent
b776a40806
commit
ecdf2c1803
5 files changed
+134
No files matched your search
@@ -208,6 +208,7 @@
|
||||
"is-ip": "^5.0.1",
|
||||
"isbn3": "^2.0.2",
|
||||
"iso-639-1": "^3.1.5",
|
||||
"jasypt": "^1.0.7",
|
||||
"javascript-obfuscator": "^5.1.0",
|
||||
"javastack.js": "^1.0.3",
|
||||
"jks-js": "^1.1.4",
|
||||
|
||||
Generated
+25
@@ -513,6 +513,9 @@ importers:
|
||||
iso-639-1:
|
||||
specifier: ^3.1.5
|
||||
version: 3.1.5
|
||||
jasypt:
|
||||
specifier: ^1.0.7
|
||||
version: 1.0.7
|
||||
javascript-obfuscator:
|
||||
specifier: ^5.1.0
|
||||
version: 5.1.0
|
||||
@@ -7932,6 +7935,10 @@ packages:
|
||||
jalaali-js@1.2.7:
|
||||
resolution: {integrity: sha512-gE+YHWSbygYAoJa+Xg8LWxGILqFOxZSBQQw39ghel01fVFUxV7bjL0x1JFsHcLQ3uPjvn81HQMa+kxwyPWnxGQ==}
|
||||
|
||||
jasypt@1.0.7:
|
||||
resolution: {integrity: sha512-JOoiFaSJXoCIu6rehuCHc7FuQt4L2rgHdNeEhMC8D83AvmyI4GD1g0aUUQkH1I+AZQfsAi3v3wzt6pHQ1Ba7kg==}
|
||||
hasBin: true
|
||||
|
||||
javascript-natural-sort@0.7.1:
|
||||
resolution: {integrity: sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==}
|
||||
|
||||
@@ -8444,6 +8451,10 @@ packages:
|
||||
lru-cache@5.1.1:
|
||||
resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
|
||||
|
||||
lru-cache@6.0.0:
|
||||
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
lru-queue@0.1.0:
|
||||
resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==}
|
||||
|
||||
@@ -11723,6 +11734,9 @@ packages:
|
||||
yallist@3.1.1:
|
||||
resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
|
||||
|
||||
yallist@4.0.0:
|
||||
resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
|
||||
|
||||
yallist@5.0.0:
|
||||
resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -19631,6 +19645,11 @@ snapshots:
|
||||
|
||||
jalaali-js@1.2.7: {}
|
||||
|
||||
jasypt@1.0.7:
|
||||
dependencies:
|
||||
commander: 2.20.3
|
||||
lru-cache: 6.0.0
|
||||
|
||||
javascript-natural-sort@0.7.1: {}
|
||||
|
||||
javascript-obfuscator@5.1.0:
|
||||
@@ -20171,6 +20190,10 @@ snapshots:
|
||||
dependencies:
|
||||
yallist: 3.1.1
|
||||
|
||||
lru-cache@6.0.0:
|
||||
dependencies:
|
||||
yallist: 4.0.0
|
||||
|
||||
lru-queue@0.1.0:
|
||||
dependencies:
|
||||
es5-ext: 0.10.64
|
||||
@@ -24032,6 +24055,8 @@ snapshots:
|
||||
|
||||
yallist@3.1.1: {}
|
||||
|
||||
yallist@4.0.0: {}
|
||||
|
||||
yallist@5.0.0: {}
|
||||
|
||||
yaml-eslint-parser@1.2.2:
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { ShieldOff } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Jasypt String Encryption',
|
||||
path: '/jasypt-string-encryption',
|
||||
description: 'Encrypt and decrypt strings using the Jasypt (Java Simplified Encryption) standard.',
|
||||
keywords: ['jasypt', 'java', 'spring', 'boot', 'string', 'encryption'],
|
||||
component: () => import('./jasypt-string-encryption.vue'),
|
||||
icon: ShieldOff,
|
||||
createdAt: new Date('2026-03-15'),
|
||||
category: 'Crypto',
|
||||
});
|
||||
@@ -0,0 +1,87 @@
|
||||
<script setup lang="ts">
|
||||
import Jasypt from 'jasypt';
|
||||
|
||||
const mode = ref<'encrypt' | 'decrypt'>('encrypt');
|
||||
const password = ref('');
|
||||
const inputText = ref('');
|
||||
const outputRaw = ref('');
|
||||
const error = ref('');
|
||||
|
||||
const outputEncSyntax = computed(() =>
|
||||
outputRaw.value ? `ENC(${outputRaw.value})` : '',
|
||||
);
|
||||
|
||||
const isEncryptMode = computed(() => mode.value === 'encrypt');
|
||||
|
||||
function run() {
|
||||
error.value = '';
|
||||
try {
|
||||
const jasypt = new Jasypt();
|
||||
jasypt.setPassword(password.value);
|
||||
|
||||
if (isEncryptMode.value) {
|
||||
outputRaw.value = jasypt.encrypt(inputText.value);
|
||||
}
|
||||
else {
|
||||
outputRaw.value = jasypt.decrypt(inputText.value.trim().replace(/^ENC\(|\)$/g, ''));
|
||||
}
|
||||
}
|
||||
catch (err: any) {
|
||||
outputRaw.value = '';
|
||||
error.value = err.toString();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<NForm label-placement="left" label-width="160px">
|
||||
<NFormItem label="Mode:">
|
||||
<NRadioGroup v-model:value="mode" size="small">
|
||||
<NRadioButton value="encrypt">
|
||||
Encrypt
|
||||
</NRadioButton>
|
||||
<NRadioButton value="decrypt">
|
||||
Decrypt
|
||||
</NRadioButton>
|
||||
</NRadioGroup>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem label="Password (Secret Key):">
|
||||
<NInput
|
||||
v-model:value="password"
|
||||
type="password"
|
||||
show-password-on="click"
|
||||
placeholder="Enter Jasypt password (salt / secret key)"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NFormItem :label="isEncryptMode ? 'Plain Text:' : 'Jasypt Encrypted String:'">
|
||||
<NInput
|
||||
v-model:value="inputText"
|
||||
type="textarea"
|
||||
rows="6"
|
||||
:placeholder="isEncryptMode
|
||||
? 'Text to encrypt (e.g. DB password)'
|
||||
: 'Encrypted value (e.g. ENC(...)) or raw Jasypt string'"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
||||
<NSpace justify="center" mb-2>
|
||||
<NButton type="primary" :disabled="!password || !inputText" @click="run">
|
||||
{{ isEncryptMode ? 'Encrypt' : 'Decrypt' }}
|
||||
</NButton>
|
||||
</NSpace>
|
||||
|
||||
<c-alert v-if="error" mb-1>
|
||||
{{ error }}
|
||||
</c-alert>
|
||||
|
||||
<NCard v-if="outputRaw" title="Results">
|
||||
<input-copyable label="Decoded:" label-position="left" :value="outputRaw" mb-1 />
|
||||
<input-copyable v-if="isEncryptMode" label="Raw:" label-position="left" :value="outputRaw" mb-1 />
|
||||
<input-copyable v-if="isEncryptMode" label="ENC Form:" label-position="left" :value="outputEncSyntax" />
|
||||
</NCard>
|
||||
</NForm>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,8 @@
|
||||
declare module 'jasypt' {
|
||||
export default class Jasypt {
|
||||
constructor() {}
|
||||
setPassword(password: string): void
|
||||
encrypt(value: string): string
|
||||
decrypt(value: string): string
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user