Python Forum
length constraint on phrase hash to password
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
length constraint on phrase hash to password
#1
Background
I have a general question regarding creating hashes from a passphrase, where the hash output will have to be constrained to a certain number of characters, using the sha256 hash. Note: my environment is currently limiting me to the hash methods available in hashlib for Python 3.5

I want to create login passwords for my use as a login password. It occurred to me I could use the hash function to do this. Note that I am not trying to hash passwords and store securely on a web site; instead, I'm hashing a phrase well known to me, to be the password that I create to log into the site. This allows me to have a general phrase which I can modify for an explicit site, so I don't have to memorize or write down a bunch of passwords.

So, given the phrase "This is a hashable phrase which will become a hash using sha256.". The 'digest' from this, per sha256 will return 32 bytes, which frequently will exceed the length of common web sites; I most frequently run into length constraints of 10 - 15 characters.

My question:
if I return the hashed digest, and strip off the remaining characters so that it limits the returned hash value (e.g., hashValue[:length], is that a big deal? I realize it's removing some of the security, but the web site login is already limiting the length.

It seems to me that this should be acceptable, but I'm not very deep into security.

Thanks!

javaben
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] How to crack hash with hashlib Milan 0 1,394 Mar-09-2023, 08:25 PM
Last Post: Milan
  FOREIGN KEY constraint failed SalsaBeanDip 2 2,764 Dec-05-2020, 10:22 PM
Last Post: SalsaBeanDip
  SQLite Unique constraint failed error djwilson0495 3 13,402 Aug-14-2020, 05:23 PM
Last Post: ndc85430
  Hash command works differently for me in CMD and Spyder ZweiDCG 3 2,345 Sep-10-2019, 01:10 PM
Last Post: DeaD_EyE
  Reverse order of phrase Error ilondire05 4 2,493 Aug-29-2019, 04:19 PM
Last Post: buran
  Create file archive that contains crypto hash ED209 1 2,041 May-29-2019, 03:05 AM
Last Post: heiner55
  Fastest dict/map method when 'key' is already a hash? tasket 6 3,965 Apr-20-2019, 06:40 PM
Last Post: tasket
  Finding exact phrase in list graham23s 2 2,871 Mar-13-2019, 06:47 PM
Last Post: graham23s
  Probelm using Boolean input phrase.isupper() skrivver99 4 3,098 Nov-04-2018, 09:21 AM
Last Post: Larz60+
  phrase loop and character comparision shiro26 6 4,058 Jul-06-2018, 02:03 AM
Last Post: shiro26

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020