Skip to content

Instantly share code, notes, and snippets.

//Add this to the browser console of https://www.funnyhowtheknightmoves.com/
/**
* Creates line element on given position, with given length and angle.
*/
function createLineElement(x, y, length, angle) {
var line = document.createElement("div");
var styles = 'border: 1px solid black; '
+ 'width: ' + length + 'px; '
+ 'height: 0px; '
@unrealwill
unrealwill / Readme.txt
Last active March 28, 2022 16:40
LaBanquePostale Security
Tried to make a payment on aliexpress this weekend.
Turns out the payment processor (wlp-acs.com), after a first valid SMS code check, is requesting my bank secret password.
Didn't give it, no way I'm giving it so the payment was rejected.
For information the identifier for accounts on this bank is written on every cheque you make.
See screenshot below :
I called the bank this morning, and they assured me this is normal that it is "required by law", they call it "second factor".
//Compilation with :
//g++ -std=c++17 -O3 wordle.cpp -o wordle
/*
This is a single threaded, zero memory allocation, recursive exhaustive search of the wordle search space
Just to see how far a brute-force approach would go
Every guess split the list of remaining possible words into one of (3^5=243) buckets
At the next tree level the list inside each bucket is examined recursively, until there are 2 candidates left.
No specialized solver to finish the small lists have been used.
License MIT
*/
import onnx
from onnx_tf.backend import prepare
import tensorflow as tf
import onnxruntime
from PIL import Image
import numpy as np
import sys
#You need to have model.onnx and neuralhash_128x96_seed1.dat in your working directory
@unrealwill
unrealwill / collisionLSH.py
Created August 8, 2021 10:20
Proof of Concept : generating collisions on a neural perceptual hash
import tensorflow as tf #We need tensorflow 2.x
import numpy as np
#The hashlength in bits
hashLength = 256
def buildModel():
#we can set the seed to simulate the fact that this network is known and doesn't change between runs
#tf.random.set_seed(42)
model = tf.keras.Sequential()
import numpy as np
def cosd( ang ):
return np.cos(2*np.pi*ang/360.0)
def sind( ang):
return np.sin(2*np.pi*ang/360.0)
def measure3( alpha, phi, r1,r2):
d = 2
#LICENSE MIT#
from keras.models import Model
from keras.layers import Input, Dense, Merge, Recurrent
from keras.layers.recurrent import SimpleRNN, GRU,LSTM
from keras.layers.embeddings import Embedding
from keras.layers.wrappers import TimeDistributed
import random