
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
masq-crypto
Advanced tools
Promise-based crypto library used by Qwant Masq. It allows applications to encrypt and decrypt JSON data. The cipher used is AES GCM which provides integrity and confidentiality.
The library includes a passphrase generator and key derivation using the PBKDF2 algorithm.
git clone https://github.com/QwantResearch/masq-crypto.git
cd masq-crypto
npm install
Add the client JS reference in your page:
<script type="text/javascript" src="src/index.js"></script>
Using the crypto library in your app:
// EXAMPLE
const apiData = { POI_1: 'Tour eiffel', POI_2: 'Cafeteria'}
// If no passphrase is given, it will be generated.
deriveKey('').then(function (derivedKey) {
// encryption
encrypt(derivedKey, JSON.stringify(apiData), '1.0.0').then(function (encryptedJson) {
console.log(encryptedJson)
// Object { ciphertext: "cb9a804…", iv: "145a65b6535d00b5a3cce475", version: "1.0.0" }
// decryption
decrypt(derivedKey, encryptedJson).then(function (decryptedJson) {
console.log(decryptedJson) // { POI_1: "Tour eiffel", POI_2: "Cafeteria"}
})
})
})
Useful functions to convert between ArrayBuffer - String and hexString, examples:
let testRes = ''
if (toString(toArray('bonjour')) !== 'bonjour') { testRes = 'Fail' } else { testRes = 'Success' }
console.log('array <-> ascii conversion :' + testRes)
if (bufferToHexString(hexStringToBuffer('11a1b2')) !== '11a1b2') { testRes = 'Fail' } else { testRes = 'Success' }
console.log('array <-> hexString conversion : ' + testRes)
Apache-2.0
FAQs
Crypto wrapper for Masq
The npm package masq-crypto receives a total of 9 weekly downloads. As such, masq-crypto popularity was classified as not popular.
We found that masq-crypto demonstrated a not healthy version release cadence and project activity because the last version was released 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
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.