security - How safe is this procedure? -
i'm going use kind of approach store password:
- user enters password
- application salts password random number
- then salted password encrypt encryption algorithm randomly selected array of data (consisting predefined table of chars/bytes)
- for simplicity can used table of digits, in case of digits random array long enough integer/biginteger.
- then store in db salt (modified value) , encrypted array
to check password validity:
- getting given password
- read salt db , calculate decrypt key
- try decrypt encrypted array
- if successfull (in mathematical mean) compare decrypted value byte byte
- does contains chars/bytes known table. instance integer/biginteger? if - password counts valid
what think procedure?
in few words, it's kind of alternative using hash functions...
in approach encryption algorithm used calculation of non-inversible value.
edit
# encrypt/decrypt function works this: key=hash(password) cyphertext = encrypt(plaintext, key) plaintext = decrypt(cyphertext, key) # encrypting password when entered key=hash(password)+salt or hash(password+salt) array={a1, a2,... ai} some_table=random({array}) encrypted_table = encrypt(some_table, key + salt) # checking validity decrypt(encrypted_table, password + salt) == some_table if(some_table contains {array} elements) = valid else invalid
the proposed scheme is, @ best, less secure storing hash of password , salt.
this because encryption step adds small constant amount of time checking if each hash value correct; @ same time introduces classes of equivalent hashes, since there multiple possible permutations of array
recognised valid.
Comments
Post a Comment