
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
email-scramble
Advanced tools
Scrambles email addresses and phone numbers with ROT-18 to hide them from bots
Universal JavaScript helper to encode/decode email addresses and phone numbers with ROT-18 to hide them from bots. This library can be used server-side with Node or on the front-end (CommonJS, AMD, global variable).
Have a look at the examples. If you'd like to know more about obfuscation techniques and their success ratio, here's a great blog post on the subject.
email-scramble uses a simple ROT transformation. The default rotation is ROT-18, which means that letters will be rotated by 13 and numbers by 5.
var encodedEmail = emailScramble.encode('mail@example.com');
var decodedMail = emailScramble.decode(encodedMail);
// You can also pick any other flavor of ROT:
function myROT(str) {
// Here letters are obfuscated with ROT-13 and numbers are kept clear.
return emailScramble.rot(13, 0, str);
}
// Functional-programming partial application style:
var myRot = emailScramble.rot.bind(emailScramble, 13, 0);
Here's a real-world example:
// <a href="znvygb:znvy@rknzcyr.pbz" data-email-scramble>Send me an email!</a>
var links = document.querySelectorAll('[data-email-scramble]');
links.forEach(function decodeLink(link) {
link.href = emailScramble.decode(link.href);
});
email-scramble
is available on npm, or you can download a ZIP
npm install --save email-scramble
This library can be used as an ES6 module, Node/Browserify CommonJS-like module, a RequireJS AMD module or a global:
// ES6
import emailScramble from 'email-scramble';
// The CommonJS way.
var emailScramble = require('email-scramble');
// Global variable.
var emailScramble = window.emailScramble;
# Install deps
npm install
# Test
npm test
npm run lint
# Install git hooks
./.githooks/deploy
Copyright (c) 2016, Thibaud Colas
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
FAQs
Scrambles email addresses and phone numbers with ROT-18 to hide them from bots
We found that email-scramble 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.