diff --git a/README.md b/README.md index 2ff6260..ee7a1b4 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,4 @@ I made it because I want to try to break it. (Precisely: Show it does not provide semantic security, because it is not IND-CPA-secure) This will work iff I succeed in building a PPT-discriminator for sha256 from randomness As my first approach this discriminator will be based on an LSTM-network. +Update: This worked out way better than expected; given long enought sequences (128 Bytes are more than enough) we can discriminate successfully in 100% of cases. diff --git a/discriminator.py b/discriminator.py index 4c088f0..8039044 100644 --- a/discriminator.py +++ b/discriminator.py @@ -59,9 +59,7 @@ def train(model, seq_len=16*64): correct = round(y_pred.item()) == y ltLoss = ltLoss*0.9 + 0.1*loss.item() lltLoss = lltLoss*0.9 + 0.1*ltLoss - print({ 'epoch': epoch, 'loss': loss.item(), 'ltLoss': ltLoss, 'correct?': correct}) - if ltLoss < 0.20 and lltLoss < 0.225: - print("[*] Hell Yeah! Poccing! Got sup") + print({ 'epoch': epoch, 'loss': loss.item(), 'ltLoss': ltLoss, 'correct?': correct }) if epoch % 8 == 0: torch.save(model.state_dict(), 'model_savepoints/'+tid+'_'+str(epoch)+'.n') diff --git a/wh_discriminator.n b/wh_discriminator.n new file mode 100644 index 0000000..6608880 Binary files /dev/null and b/wh_discriminator.n differ