Snippet: Creating secure Password Hashes in Java with Heimdall

These days where a cheap GPU for about 100 € is capable to create 3 billion of MD5 Hashes per second, we need not only need to use salts the right way but we also need to choose a strong, non-reversible and slow hashing schemes when storing passwords in our application. Heimdall is a library that implements a secure and upgradable password hashing mechanism and uses at the time of writing this article PBKDF2 SHA-1 HMAC with 20000 iterations and a 192 bit (24 byte) salt per default. ...

July 12, 2015 · 3 min · 588 words · Micha Kops

Postgres Snippets

Show Indizes and their size in a specific schema SELECT tablename, indexname, indexdef, pg_size_pretty(pg_relation_size(schemaname || '.' || indexname)) AS index_size FROM pg_indexes WHERE schemaname = 'SCHEMANAME' ORDER BY pg_relation_size(schemaname || '.' || indexname) DESC; Select statement_timeout settings for all users SELECT r.rolname, (SELECT unnest(s.setconfig) FROM pg_db_role_setting s WHERE s.setrole = r.oid AND s.setconfig::text LIKE '%statement_timeout%' LIMIT 1) AS statement_timeout FROM pg_roles r WHERE r.rolcanlogin ORDER BY r.rolname; Get size of a table SELECT pg_size_pretty(pg_total_relation_size('schemaname.tablename')); ...

March 1, 2010 · 12 min · 2398 words · Micha Kops