예제 #1
0
 public static String aktivationkeyCreation(
     String username, String mail, Integer Zufallszahl1, Integer Zufallszahl2) {
   float fl = Zufallszahl1 / Zufallszahl2;
   String starttext =
       HelpFunctions.sha256(
           "s"
               + HelpFunctions.sha256(
                   HelpFunctions.sha256(
                           "Aktivierungskey"
                               + username
                               + "123"
                               + mail
                               + "XYZ"
                               + Float.toString(fl)
                               + "fff")
                       + Zufallszahl1.toString())
               + Zufallszahl2.toString());
   return HelpFunctions.sha256(
       HelpFunctions.sha256(
           HelpFunctions.sha256(HelpFunctions.sha256(HelpFunctions.sha256(starttext)))));
 }
예제 #2
0
  public static boolean checkCaptcha(String CaptchaResponse) {
    String Secret = "6LcBYBATAAAAAPHUZfB4OFpbdwrVxp08YEaVX3Dr";
    String Returnstring = "";

    System.out.println("## Validate:");
    System.out.println(
        "https://www.google.com/recaptcha/api/siteverify?response="
            + CaptchaResponse
            + "&secret="
            + Secret);

    try {
      Returnstring = HelpFunctions.sendPost(CaptchaResponse, Secret);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    if (Returnstring.equals("{  \"success\": true}")) {
      return true;
    } else {
      return false;
    }
  }