
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Format preserving string substitution encryption
In general, format-preserving encryption is a type of encryption such that the output (the ciphertext) is in the same format as the input (the plaintext).
This library uses a simple substitution cipher algorithm. Read more about the security of this library in the dedicated section below.
cipher with default domain ([0-9])
import fpe from 'node-fpe';
const cipher = fpe({ secret: 'secret!' });
cipher.encrypt('1234567');
// '7130548'
cipher.decrypt('7130548');
// '1234567'
cipher with a custom domain ([A-E])
import fpe from 'node-fpe';
const cipher = fpe({ secret: 'secret!', domain: ['A', 'B', 'C', 'D', 'E'] });
cipher.encrypt('BEEBEE');
// 'ABBABB'
cipher.decrypt('ABBABB');
// 'BEEBEE'
Options to pass on to node-fpe are:
secret
: mandatory. a secret used in the underlying hash function.domain
: optional. an array of characters used as the FPE domain. default: 0-9 digitsThis module is using the term format-preserving encryption, however it is not a proper fpe implementation. It is basically a substitution cipher, you can use it to scramble and de-scramble strings but it is not recommended to use it with anything sensitive as the encryption is weak.
For fpe, there are other libraries available:
FAQs
Format-preserving encryption implementation
The npm package node-fpe receives a total of 3,045 weekly downloads. As such, node-fpe popularity was classified as popular.
We found that node-fpe demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.