const SecurityTools = require("@adrielkirch/security-basic-tools");
const uuid = SecurityTools.generateUUID();
console.log(uuid);
const userId = "user123";
const secretKey = "my_secret_key";
const token = SecurityTools.generateJwt(userId, secretKey);
console.log(token);
const decodedUserId = SecurityTools.decodedJwt(token, secretKey);
console.log(decodedUserId);
const data = "password123";
const salt = "random_salt";
const hashedData = SecurityTools.generateHashWithSalt(data, salt);
console.log(hashedData);
const dataToEncrypt = "sensitive_data";
const encryptionKey = "my_encryption_key";
const iv = Buffer.from("my_initialization_vector", "hex");
const encryptedData = SecurityTools.encryptAES(dataToEncrypt, encryptionKey, iv);
console.log(encryptedData);
const decryptedData = SecurityTools.decryptAES(encryptedData, encryptionKey, iv);
console.log(decryptedData);
const limiter = SecurityTools.httpLimiterByIp(10, 60, "Too many requests from this IP, please try again later.", false);
app.use(limiter);
const corsMiddleware = SecurityTools.corsMiddleware();
app.use(corsMiddleware);
This project is licensed under the MIT License - see the LICENSE file for details.