security - How safe is this procedure? -


i'm going use kind of approach store password:

  1. user enters password
  2. application salts password random number
  3. 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.
  4. then store in db salt (modified value) , encrypted array

to check password validity:

  1. getting given password
  2. read salt db , calculate decrypt key
  3. try decrypt encrypted array
  4. 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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -