Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
captcha-lite
Advanced tools
Lite captcha generator by Pure Javascript.
node-captcha-lite just extends node-pnglib, you can check its document for constructor options since we only add some public methods on it.
Let's try to draw number:
'use strict';
const fs = require('fs');
const path = require('path');
const Captcha = require('..');
const FONTS = Captcha.FONTS;
function rand(min, max) {
let comp = max - min;
return (Math.random() * comp + min) | 0;
}
function getRandFont(fonts) {
const fontNames = Object.keys(fonts);
return fonts[fontNames[rand(0, fontNames.length)]];
}
let png = new Captcha(200, 100, 8, [255, 255, 255, 255]);
let chars = getRandFont(FONTS).chars;
for (let i = 0; i < chars.length; ++i) {
let font = getRandFont(FONTS);
let ch = chars[i];
png.drawChar(ch, 0 + 2 * i * font.w, 50, font, '#00FF00');
}
fs.writeFileSync(path.resolve(__dirname, './char.png'), png.getBuffer());
Output:
Let's try to draw bezier curve:
'use strict';
const fs = require('fs');
const path = require('path');
const Captcha = require('..');
const png = new Captcha(300, 300, 8, [255,255,255,255]);
const bezierPoints = [
[250, 50],
[250, 250],
[260, 70],
[60, 70]
];
png.drawBezier(bezierPoints, {
tolerance: 0, // 曲线线条扩宽的距离
step: 1/1000, // 每两个点之间绘制1000个点
fixEndPointCurve: true, // 是否绘制开始和结束点的曲线
handlerRatio: 0.5, // 贝塞尔曲线的句柄长度(连续贝塞尔模型)
color: '#cc0044' // 曲线的颜色
});
fs.writeFileSync(path.resolve(__dirname, './bezier.png'), png.getBuffer());
Output:
FAQs
Lite captcha generator by Pure Javascript.
The npm package captcha-lite receives a total of 0 weekly downloads. As such, captcha-lite popularity was classified as not popular.
We found that captcha-lite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.