Compare commits

..
Author SHA1 Message Date
ShareVB 96f6262392 fix: wrong key length 2024-08-26 17:49:40 +02:00
sharevb 8b933792cf feat(new tool): WPA PSK Raw Key Generator
Fix #1236
2024-08-25 19:24:56 +02:00
12 changed files with 122 additions and 88 deletions

No files matched your search

-21
View File
@@ -1,21 +0,0 @@
name: "Pull Requests Merge Conflicts Tagger"
on:
# So that PRs touching the same files as the push are updated
push:
# So that the `dirtyLabel` is removed if conflicts are resolve
# We recommend `pull_request_target` so that github secrets are available.
# In `pull_request` we wouldn't be able to change labels of fork PRs
pull_request_target:
types: [synchronize]
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: check if prs are dirty
uses: eps1lon/actions-label-merge-conflict@v3
with:
dirtyLabel: "PR: needs rebase"
repoToken: "${{ secrets.GITHUB_TOKEN }}"
commentOnDirty: "This pull request has conflicts, please resolve those before we can evaluate the pull request."
# commentOnClean: "Conflicts have been resolved. A maintainer will review the pull request shortly."
+2 -4
View File
@@ -129,6 +129,7 @@ declare module '@vue/runtime-core' {
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
NButton: typeof import('naive-ui')['NButton']
NCode: typeof import('naive-ui')['NCode']
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
@@ -138,20 +139,16 @@ declare module '@vue/runtime-core' {
NH1: typeof import('naive-ui')['NH1']
NH3: typeof import('naive-ui')['NH3']
NIcon: typeof import('naive-ui')['NIcon']
NInput: typeof import('naive-ui')['NInput']
NInputNumber: typeof import('naive-ui')['NInputNumber']
NLayout: typeof import('naive-ui')['NLayout']
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
NLi: typeof import('naive-ui')['NLi']
NMenu: typeof import('naive-ui')['NMenu']
NP: typeof import('naive-ui')['NP']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSlider: typeof import('naive-ui')['NSlider']
NSwitch: typeof import('naive-ui')['NSwitch']
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
PasteAsMarkdown: typeof import('./src/tools/paste-as-markdown/paste-as-markdown.vue')['default']
PdfSignatureChecker: typeof import('./src/tools/pdf-signature-checker/pdf-signature-checker.vue')['default']
PdfSignatureDetails: typeof import('./src/tools/pdf-signature-checker/components/pdf-signature-details.vue')['default']
PercentageCalculator: typeof import('./src/tools/percentage-calculator/percentage-calculator.vue')['default']
@@ -189,6 +186,7 @@ declare module '@vue/runtime-core' {
UserAgentResultCards: typeof import('./src/tools/user-agent-parser/user-agent-result-cards.vue')['default']
UuidGenerator: typeof import('./src/tools/uuid-generator/uuid-generator.vue')['default']
WifiQrCodeGenerator: typeof import('./src/tools/wifi-qr-code-generator/wifi-qr-code-generator.vue')['default']
WpaPskGenerator: typeof import('./src/tools/wpa-psk-generator/wpa-psk-generator.vue')['default']
XmlFormatter: typeof import('./src/tools/xml-formatter/xml-formatter.vue')['default']
XmlToJson: typeof import('./src/tools/xml-to-json/xml-to-json.vue')['default']
YamlToJson: typeof import('./src/tools/yaml-to-json-converter/yaml-to-json.vue')['default']
-1
View File
@@ -35,7 +35,6 @@
"release": "node ./scripts/release.mjs"
},
"dependencies": {
"@github/paste-markdown": "^1.5.3",
"@it-tools/bip39": "^0.0.4",
"@it-tools/oggen": "^1.3.0",
"@sindresorhus/slugify": "^2.2.1",
+7 -14
View File
@@ -5,9 +5,6 @@ settings:
excludeLinksFromLockfile: false
dependencies:
'@github/paste-markdown':
specifier: ^1.5.3
version: 1.5.3
'@it-tools/bip39':
specifier: ^0.0.4
version: 0.0.4
@@ -2162,10 +2159,6 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
/@github/paste-markdown@1.5.3:
resolution: {integrity: sha512-PzZ1b3PaqBzYqbT4fwKEhiORf38h2OcGp2+JdXNNM7inZ7egaSmfmhyNkQILpqWfS0AYtRS3CDq6z03eZ8yOMQ==}
dev: false
/@humanwhocodes/config-array@0.11.10:
resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==}
engines: {node: '>=10.10.0'}
@@ -3367,7 +3360,7 @@ packages:
dependencies:
'@unhead/dom': 0.5.1
'@unhead/schema': 0.5.1
'@vueuse/shared': 11.0.3(vue@3.3.4)
'@vueuse/shared': 10.11.1(vue@3.3.4)
unhead: 0.5.1
vue: 3.3.4
transitivePeerDependencies:
@@ -4000,19 +3993,19 @@ packages:
- vue
dev: false
/@vueuse/shared@10.3.0(vue@3.3.4):
resolution: {integrity: sha512-kGqCTEuFPMK4+fNWy6dUOiYmxGcUbtznMwBZLC1PubidF4VZY05B+Oht7Jh7/6x4VOWGpvu3R37WHi81cKpiqg==}
/@vueuse/shared@10.11.1(vue@3.3.4):
resolution: {integrity: sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==}
dependencies:
vue-demi: 0.14.5(vue@3.3.4)
vue-demi: 0.14.10(vue@3.3.4)
transitivePeerDependencies:
- '@vue/composition-api'
- vue
dev: false
/@vueuse/shared@11.0.3(vue@3.3.4):
resolution: {integrity: sha512-0rY2m6HS5t27n/Vp5cTDsKTlNnimCqsbh/fmT2LgE+aaU42EMfXo8+bNX91W9I7DDmxfuACXMmrd7d79JxkqWA==}
/@vueuse/shared@10.3.0(vue@3.3.4):
resolution: {integrity: sha512-kGqCTEuFPMK4+fNWy6dUOiYmxGcUbtznMwBZLC1PubidF4VZY05B+Oht7Jh7/6x4VOWGpvu3R37WHi81cKpiqg==}
dependencies:
vue-demi: 0.14.10(vue@3.3.4)
vue-demi: 0.14.5(vue@3.3.4)
transitivePeerDependencies:
- '@vue/composition-api'
- vue
+15 -3
View File
@@ -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 emailNormalizer } from './email-normalizer';
import { tool as wpaPskGenerator } from './wpa-psk-generator';
import { tool as asciiTextDrawer } from './ascii-text-drawer';
@@ -9,7 +10,6 @@ import { tool as textToUnicode } from './text-to-unicode';
import { tool as safelinkDecoder } from './safelink-decoder';
import { tool as xmlToJson } from './xml-to-json';
import { tool as jsonToXml } from './json-to-xml';
import { tool as pasteAsMarkdown } from './paste-as-markdown';
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
import { tool as numeronymGenerator } from './numeronym-generator';
import { tool as macAddressGenerator } from './mac-address-generator';
@@ -89,7 +89,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,
passwordStrengthAnalyser,
pdfSignatureChecker,
wpaPskGenerator,
],
},
{
name: 'Converter',
@@ -179,7 +192,6 @@ export const toolsByCategory: ToolCategory[] = [
textDiff,
numeronymGenerator,
asciiTextDrawer,
pasteAsMarkdown,
],
},
{
-12
View File
@@ -1,12 +0,0 @@
import { Markdown } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Paste as Markdown',
path: '/paste-as-markdown',
description: 'Paste cells/tables and links from clipboard content as Markdown',
keywords: ['paste', 'cell', 'table', 'links', 'md', 'markdown'],
component: () => import('./paste-as-markdown.vue'),
icon: Markdown,
createdAt: new Date('2024-07-14'),
});
@@ -1,31 +0,0 @@
<script setup lang="ts">
import { subscribe } from '@github/paste-markdown';
import CInputText from '@/ui/c-input-text/c-input-text.vue';
const inputElement = ref<typeof CInputText>();
const markdown = ref('');
// Subscribe the behavior to the textarea.
onMounted(() => {
subscribe(inputElement.value?.textareaRef as never);
});
</script>
<template>
<c-card title="Paste in Markdown" class="paste-zone">
<n-ul>
<n-li>Paste spreadsheet cells and HTML tables as a Markdown tables.</n-li>
<n-li>Paste URLs on selected text as Markdown links.</n-li>
<n-li>Paste text containing links as text containing Markdown links.</n-li>
<n-li>Paste image URLs as Markdown image links.</n-li>
</n-ul>
<CInputText
ref="inputElement"
v-model:value="markdown"
multiline
placeholder="Paste your content here..."
rows="10"
w-full
/>
</c-card>
</template>
+12
View File
@@ -0,0 +1,12 @@
import { Wifi } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'WPA PSK generator',
path: '/wpa-psk-generator',
description: 'WPA Pre-shared Key Generator to convert a WPA passphrase and SSID to the 256-bit pre-shared ("raw") key',
keywords: ['wpa', 'psk', 'pre', 'shared', 'key', 'ssid', 'passphrase', 'generator'],
component: () => import('./wpa-psk-generator.vue'),
icon: Wifi,
createdAt: new Date('2024-08-15'),
});
@@ -0,0 +1,13 @@
import { describe, expect, it } from 'vitest';
import { generateWpaPskRawKey } from './wpa-psk-generator.service';
describe('wpa-psk-generator', () => {
it('generateWpaPskRawKey should generate raw key', () => {
expect(generateWpaPskRawKey('test', 'test')).to.deep.eq({
passphrase: 'test',
psk: 'd630c5513becfd3952432bd7fcf098b7a40907f3214cf43551f1b8cfda873ecc',
ssid: 'test',
});
expect(generateWpaPskRawKey('test', 'test')?.psk).toHaveLength(256 / 8 * 2);
});
});
@@ -0,0 +1,15 @@
import CryptoJS from 'crypto-js';
import pbkdf2 from 'crypto-js/pbkdf2';
export function generateWpaPskRawKey(ssid: string, passphrase: string) {
const psk = pbkdf2(passphrase, ssid, {
keySize: 256 / 32,
iterations: 4096,
hasher: CryptoJS.algo.SHA1,
}).toString(CryptoJS.enc.Hex);
return {
ssid,
passphrase,
psk,
};
}
@@ -0,0 +1,58 @@
<script setup lang="ts">
import { generateWpaPskRawKey } from './wpa-psk-generator.service';
import { useValidation } from '@/composable/validation';
const ssid = ref('');
const passphrase = ref('');
const wpaPSKRawKey = ref('');
function computeRawKey() {
try {
wpaPSKRawKey.value = generateWpaPskRawKey(ssid.value, passphrase.value)?.psk;
}
catch (e: any) {
wpaPSKRawKey.value = e.toString();
}
}
const ssidValidation = useValidation({
source: ssid,
rules: [
{
validator: v => v !== '',
message: 'SSID must not be empty.',
},
],
});
</script>
<template>
<div style="max-width: 600px;">
<c-card title="Wifi Infos" mb-2>
<c-input-text
v-model:value="ssid"
label="SSID"
label-position="left"
placeholder="Put your SSID here..."
:validation="ssidValidation"
mb-2
/>
<c-input-text
v-model:value="passphrase"
label="Passphrase"
label-position="left"
placeholder="Put your Passphrase here..."
mb-2
/>
<div flex justify-center>
<n-button @click="computeRawKey()">Compute</n-button>
</div>
</c-card>
<c-card title="WPA PSK Raw Key (256 bits)">
<TextareaCopyable :value="wpaPSKRawKey" />
</c-card>
</div>
</template>
-2
View File
@@ -137,8 +137,6 @@ onMounted(() => {
defineExpose({
inputWrapperRef,
textareaRef,
inputRef,
focus,
blur,
});