3 ms·
I think at least Django stores passwords with an additional field that defines the algorithm used to generate the hash of the password. One could think of a cas
by heavenlyblue 9y ago
I think at least Django stores passwords with an additional field that defines the algorithm used to generate the hash of the password. One could think of a case where instead of algorithm selection you could properly define a simplistic DSL that actually defines how the hash is generated:
algo | hash
bcrypt(hardness=2,input=INPUT + 23423526) | 938240
bcrypt(hardness=3,input=INPUT + 342352643) | 239223
Now the only thing that one needs to do is convert this table to:
algo | hash
bcrypt(hardness=3,bcrypt(hardness=2,input=INPUT + 23423526)) | 23423423
bcrypt(hardness=3,bcrypt(hardness=3,input=INPUT + 342352643)) | 90192902
Where
bcrypt(hardness=3,938240) = 23423423
bcrypt(hardness=3,239223) = 90192902