java - Apache Shiro - password format issue -



java - Apache Shiro - password format issue -

i seek utilize passwordmatcher defaultpasswordservice defaulthashservice.

defaulthashservice hashservice = new defaulthashservice(); hashservice.sethashiterations(10000); hashservice.sethashalgorithmname(sha512hash.algorithm_name); hashservice.setgeneratepublicsalt(true); defaultpasswordservice passwordservice = new defaultpasswordservice(); passwordservice.sethashservice(hashservice); string encryptedpassword = passwordservice.encryptpassword("password"); system.out.println("result:"+encryptedpassword);

and here result must save database in column password.

$shiro1$sha-512$10000$t5nkqea3qjmlpub/x+wn4q==$qwviyjbljsmwh7fsvhecklxqqxy11lv8es4guxd9t8d4htekcln/muytnhzyz+yvi1ykeg6l7t2km3qykug0xq==

everything working. question why iterations number , algorithm name saved salt , password? case inform potential attacker, dumps our database such of import properties.

nowadays, aim protect user passwords when attacker knows implementation secrets. known "white-box encryption":

in such context, ‘white-box attacker’ has total access software implementation of cryptographic algorithm: binary visible , alterable attacker; , attacker has total command on execution platform (cpu calls, memory registers, etc.). hence, implementation sole line of defence.

that beingness said, can store hash algorithm , iteration count password, have assume attacker has access code/binaries anyways (which not unlikely if have access database).

storing number of iterations hash has additional benefit: in future might want alter larger number of iterations, since processing powerfulness has increased. can upgrade database going through hashes old number of iterations, apply number of additional iterations , store new result in database, upgraded more secure scheme.

similarly, if add together hash algorithm hash, may alter other password schemes (bcrypt, ...) later , upgrade users gracefully on next login.

java java-ee hash shiro

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -