daniel-e / captcha Goto Github PK
View Code? Open in Web Editor NEWCAPTCHA library written in Rust.
License: MIT License
CAPTCHA library written in Rust.
License: MIT License
The captcha is too hard to solve, and I'm trying one on lemmy.ml.
Thanks for this crate, however sadly captcha's like this are easily "defeated" by bots, are there any plans to create a new ai-powered captcha? Something like hcaptcha, if yes, I could try my best to help
I made some changes to this project update dependencies remove unnecessary dependencies update to 2018 edition rust and format code and refactor if you think these changes are useful,I will send pull request
It would be helpful to know how effective machine learning is at solving the captchas generated by this library so that applications can know how many subsequent tries to allow and the library can use real data to improve its security and keep up to date with the arms race.
I can see this testing being something along these lines:
Generally I'd see good security as meaning a bot has a less than 50% chance of guessing with 3 attempts on medium difficulty.
I've seen an article related to this for reference: https://towardsai.net/p/deep-learning/deep-learning-based-automatic-captcha-solver
encode binary data with base64 so that the data can be contained in JSON easily.
i think it is useful.
The dependency image 0.13.0
has a critical vulnerability.
error: Vulnerable crates found!
ID: RUSTSEC-2019-0014
Crate: image
Version: 0.13.0
Date: 2019-08-21
URL: https://rustsec.org/advisories/RUSTSEC-2019-0014
Title: Flaw in interface may drop uninitialized instance of arbitrary types
Solution: upgrade to >= 0.21.3
Dependency tree:
image 0.13.0
└── captcha 0.0.7
Solution: update dependency.
This fork has already fixed the dependency: robatipoor@8c8f9d2
Obvi I understand if this would be better as a part of a different library, but to make this crate visually-impaired compatible, it would be good if it could also generate a short audio file along with the picture. No captcha solution is complete without audio.
Hello @daniel-e! Thank you for your work!
Can you add some documentation about adding new font? How can I achieve this?
Hi,
How to use this crate to complete CAPTCHA certification? Generally, it is necessary to determine whether the content input by the user is consistent with the content in the picture, but I have not found a way to obtain the content in the picture.
The following code only ever generates blank PNGs (of the correct dimension):
let chars = "FOO".chars().collect::<Vec<char>>();
let captcha = captcha.set_chars(&chars).view(220, 120);
// do something useful with captcha.as_base64()
Everything seems to work, no error message. Here's what I get when I print the supported_chars
:
2fJUryFSQc6MvhwDaiuNXWxeBqTj9b8mCd54HnPG7k3lVt1AEZgKpsYRz
Any idea what may be going wrong?
Hi Sir,
I use your Captcha crate in Rocket, and I producing images, great. Now as I'm a novice at Rust I can't work out how to get the string that the image is displaying so I can compare it. Sorry to ask such a stupid question but I'm a little stuck.
The crate is working great and the documents got me this far.
Thank you for your time and effort,
Ashley
Hi!
I'm starting to use this library in my project and I've already run into one of your TODOs, specifically in lib.rs line 250, there's a panic when you haven't called add_char yet (the TODO is already there at line 256).
A simple solution would be calling .saturating_sub(w / 2)
instead of using -
, but I think ideally, the whole Captcha type should be refactored into two different ones (like a typestate, you'd then have a CaptchaConfig
type and you can only get a Captcha
from it if you set all the required values, and that captcha can then be cropped, rendered etc).
I've also noticed that there are a lot of minor parts of the code that aren't very idiomatic (there are 31 clippy warnings); for example, some functions have three nested matches that could easily be replaced with either ?
or an .and_then
chain, some struct initializers have redundant field names, and there are lots of clones on Copy types.
Would you be interested in a bigger PR fixing all of the smaller issues? I'd love to contribute to this project.
Best regards
I didn't find way to generate a captcha by specific text,can you add the support?
For internationalization, I'd like to be able to generate just number characters.
I can do this manually, but I'd need a captcha.set_chars(my_numbers)
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.