Giter Club home page Giter Club logo

captcha's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

captcha's Issues

Unhelpful panic inside of view() when add_char was never called

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

Works as designed, but...

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

Critical vulnerabilities

The dependency image 0.13.0 has a critical vulnerability.

See RUSTSEC-2019-0014

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

New library

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

Penetration testing

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:

  1. Script generates a data set of 1,000,000 images and their respective chars from captchas of a specific difficulty.
  2. Machine learning algorithm is trained on these images and their solutions.
  3. Script generates 100 or so new captchas and measures how many tries it takes to solve each one.

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

Feature request, audio generation.

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.

Can only generate blank PNGs

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?

update crate

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

How to get the content in the picture?

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.

Captcha too hard.

The captcha is too hard to solve, and I'm trying one on lemmy.ml.

Feature request : Add set_chars?

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).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.