
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
node-happ-decryptor
Advanced tools
Node.js (ESM) модуль для шифрования и дешифрования ссылок Happ с использованием RSA-шифрования (PKCS1v15).
RSA_PKCS1_PADDING.happ://crypt/..., happ://crypt2/..., happ://crypt3/..., happ://crypt4/....crypt → crypt2 → crypt3 → crypt4.npm i node-happ-decryptor
При инициализации необходимо передать объект с приватными ключами. Версия ключа определяется ключом свойства в объекте.
import HappProcessor from 'node-happ-decryptor';
// Конфигурация: ключи могут быть переданы как пути к файлам или как содержимое PEM
const privateKeys = {
crypt3: './keys/private_crypt3.pem', // Путь к файлу
crypt: '-----BEGIN RSA PRIVATE KEY-----...' // Строка PEM
};
const processor = new HappProcessor(privateKeys);
const link = 'happ://crypt3/OSNoL4qDcgEdum...';
try {
const result = processor.decrypt(link);
console.log('Decrypted Data:', result.decryptedData);
console.log('Key Version Used:', result.usedKey);
console.log('Link Version:', result.version);
} catch (err) {
console.error('Decryption failed:', err.message);
}
Для шифрования требуется объект с публичными ключами.
import HappProcessor from 'node-happ-decryptor';
const publicKeys = {
crypt3: './keys/public_crypt3.pem'
};
// Первый аргумент (privateKeys) можно оставить пустым, если требуется только шифрование
const processor = new HappProcessor({}, publicKeys);
try {
const result = processor.encrypt('my secret data', 'crypt3');
console.log('Generated Link:', result.link);
} catch (err) {
console.error(err.message);
}
Модуль использует механизм отката (fallback) при выборе ключа. Если ссылка содержит указание на версию happ://crypt/..., но соответствующий ключ отсутствует или не подходит, дешифратор выполнит попытки в следующей последовательности:
cryptcrypt2crypt3Результат возвращается при первом успешном совпадении.
new HappProcessor(privateKeys, publicKeys)Конструктор класса.
{ [version]: pathOrString }. Используется для дешифрования.{ [version]: pathOrString }. Используется для шифрования..decrypt(link)Дешифрует входящую строку.
happ://....{ version, usedKey, decryptedData }.Error, если формат неверен или подходящий ключ не найден..encrypt(data, version)Шифрует данные указанным ключом.
publicKeys).{ version, encryptedData, link }.FAQs
Happ link encryption and decryption module
We found that node-happ-decryptor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.