public BigInteger attack(BsGs_Key key) throws Error{
		BigInteger t = sqrt(key.p.subtract(BigInteger.ONE)).add(BigInteger.ONE); // t>sqrt(p)
		// -------------------------
		// -- Hier programmieren ---
		// -------------------------
		List<BigInteger> babyStep = new ArrayList<BigInteger>();
		List<BigInteger> giantStep = new ArrayList<BigInteger>();
		int step = 0;
		BigInteger x = BigInteger.ZERO;
		Boolean hit = false;
		
		for (BigInteger i = BigInteger.ZERO; i.compareTo(t) == -1; i = i.add(BigInteger.ONE)) {
			babyStep.add(key.y.multiply(key.g.modPow(i.negate(), key.p)).mod(key.p));
			giantStep.add(key.g.modPow(t.multiply(i), key.p));
		}
		giantStep.add(key.g.modPow(t.multiply(t), key.p));
		
		while (step < babyStep.size() && !hit) {
			if (giantStep.contains(babyStep.get(step))) {
				int i = step;
				int j = giantStep.indexOf(babyStep.get(step));
				x = BigInteger.valueOf(j).multiply(t).add(BigInteger.valueOf(i));
				hit = true;
			}
			step = step + 1;
		}
		return x;
	}