PoC of cryptographic utility functions for WoltLab Suite Core, implemented in TypeScript.
This project provides cryptographic helper functions, including:
- Creating secure signatures based on the Keyed-Hash Message Authentication Code (HMAC) algorithm.
- Hexadecimal encoding and decoding without cache-timing leaks.
npm install wsc-crypto-ts
import { createSignedStringForSession } from 'wsc-crypto-ts';
// Your session ID and secret
const sessionID = 'your-session-id';
const secret = 'your-secret-key';
// Create a signed string
const signedString = createSignedStringForSession(sessionID, secret);
console.log('Signed String:', signedString);
import { CryptoUtil } from 'wsc-crypto-ts';
// Initialize CryptoUtil with your secret
const cryptoUtil = new CryptoUtil(secret);
// Verify and decode the signed string
const decodedValue = cryptoUtil.verifySignedString(signedString);
if (decodedValue !== null) {
console.log('Decoded Value:', decodedValue.toString('utf8'));
} else {
console.error('Invalid signature!');
}
This project is licensed under the ISC License. See the LICENSE file for details.
- Sascha Greuel
- Email: hello@1-2.dev
- GitHub: SoftCreatR