From: Stephan Richter Date: Mon, 11 Sep 2017 07:46:26 +0000 (+0200) Subject: Projekt neu eingecheckt X-Git-Url: https://fpunktk.de/gitweb/?p=shamirs_secret_web_implementation.git;a=commitdiff_plain;h=6208f1f502b5c4a3e2f5b6e1771b5f7ce5dd9fbe Projekt neu eingecheckt --- 6208f1f502b5c4a3e2f5b6e1771b5f7ce5dd9fbe diff --git a/src/ScharedSecret.java b/src/ScharedSecret.java new file mode 100644 index 0000000..f38cbe3 --- /dev/null +++ b/src/ScharedSecret.java @@ -0,0 +1,135 @@ +import java.sql.Time; +import java.util.Random; + +public class ScharedSecret { + static Random rand=new Random(); + + public static int r10(){ + return rand.nextInt(10); + } + + public static int[] encodeBit(boolean bit){ + int threshold=22; + int dist=3; + + int low = threshold-dist; + int high = threshold+dist; + + int d1,d2,d3,d4,d5; + //System.out.println("\nbit: "+(bit?1:0)); + if (bit){ + //System.out.println("bounds: ["+threshold+"..."+high+"]"); + d1=r10(); + while(d1+18(240+22)?1:0); + } + } + } +}