#CaptchaSystem

1 messages · Page 1 of 1 (latest)

icy glenBOT
#

Detected code, here are some useful tools:

Formatted code
package Captcha;

import Utils.CustomFont;
import java.awt. * ;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Random;

public class CaptchaGenerator {
  private static final int WIDTH = 200;
  private static final int HEIGHT = 50;
  private static final int FONT_SIZE = 30;
  private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  private static final Random random = new Random();
  public final static Font font;
  static {
    try {
      font = CustomFont.getFont("DejaVuSans.ttf", Font.BOLD);
    } catch (IOException | FontFormatException e) {
      throw new RuntimeException(e);
    }
  }
  public static BufferedImage generateCaptchaImage(String captchaText) {
    BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
    Graphics graphics = image.getGraphics();
    graphics.setColor(Color.WHITE);
    graphics.fillRect(0, 0, WIDTH, HEIGHT);
    graphics.setColor(Color.BLACK);
    //        Font font = new Font("Dialog", Font.PLAIN, FONT_SIZE);
    //        graphics.setFont(font);
    graphics.drawString(captchaText, 50, 35);
    return image;
  }
  public static String generateRandomText(int length) {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < length; i++) {
      int index = random.nextInt(CHARACTERS.length());
      sb.append(CHARACTERS.charAt(index));
    }
    return sb.toString();
  }
}
#

<@&987246399047479336> please have a look, thanks.

pearl apex
#

fun fact, modern captcha systems (like recaptcha) dont care that much about what u click in the challenge, more about whether how u did that was human

#

they track browser history, installed fonts, mouse movement behavior, reaction rates, bookmarks, ...

#

mostly meta information

#

so unless u do it for the lolz, id suggest u to not reinvent the wheel and just integrate recaptcha or similar into ur application