public BsGs_Key(int k) {
		Random rand = new Random();
		do {
			// p waehlen
			this.p = new BigInteger(k, 400, rand);
			
			// Generator g>1 erzeugen
			factors = factorize(p.subtract(BigInteger.valueOf(1)));
		} while(factors==null);	// wiederholen falls factorize() zu lange dauert
		Boolean found;
		do {
			g = new BigInteger(k, rand); 
			g = g.remainder(p.subtract(BigInteger.valueOf(3))).add(BigInteger.ONE); // g=0 ist unguenstig
			found=true;
			for(BigInteger f: factors) {
				if(g.modPow((p.subtract(BigInteger.valueOf(1))).divide(f), p).compareTo(BigInteger.ONE)==0) {
					found=false;
					break; 
				}
			}
		} while(!found);
		do{
			// x waehlen
			this.x = new BigInteger(k, rand).remainder(p.subtract(BigInteger.valueOf(2)));
			// y berechnen
			this.y=g.modPow(x, p);
			this.x=BigInteger.valueOf(345641583492l).mod(p); //Schummelunterdruecker
		}while(this.y.equals(BigInteger.ONE)); // y=1 ausschließen
	}