Bitcoin Forum
June 21, 2018, 03:08:33 PM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: 1 2 [All]
  Print  
Author Topic: A trick for long passwords in Linux  (Read 2050 times)
RodeoX
Legendary
*
Online Online

Activity: 2660
Merit: 1049


The revolution will be monetized!


View Profile
August 16, 2011, 08:08:58 PM
 #1

A quick tip for creating long passwords in Linux.

Open a terminal window and type in the following command:

rodeox@Linux-ThinkPad:~$ echo -n test |md5sum

The part in red will be your user and computer name. The part in purple will be your easy to remember password.
Now hit enter and your computer will create an Md5 key for you.

Example for the word "test":
098f6bcd4621d373cade4e832627b4f6

Now any time I want to remember that long string of numbers and letters I just go to my terminal and enter my easy password. Each time it will give the same answer.

The gospel according to Satoshi - https://bitcoin.org/bitcoin.pdf

Free bitcoin in AFRICA - https://bitcointalk.org/index.php?topic=2710325.msg27720734
"With e-currency based on cryptographic proof, without the need to trust a third party middleman, money can be secure and transactions effortless." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1529593713
Hero Member
*
Offline Offline

Posts: 1529593713

View Profile Personal Message (Offline)

Ignore
1529593713
Reply with quote  #2

1529593713
Report to moderator
1529593713
Hero Member
*
Offline Offline

Posts: 1529593713

View Profile Personal Message (Offline)

Ignore
1529593713
Reply with quote  #2

1529593713
Report to moderator
sd
Hero Member
*****
Offline Offline

Activity: 730
Merit: 500



View Profile
August 16, 2011, 08:32:26 PM
 #2

RodeoX,

My guess is if I take the MD5 hash of every word in an English wordlist, plus every word with a single number after it I will have your passwords in that list. It should not take long to do that amount of hashing on a modern CPU.

Your scheme is better than using dictionary words but not by much.


I normally generate passwords with something like:
dd if=/dev/urandom bs=1 count=6 2>/dev/null | base64

One password per account as password reuse is evil. Adjust the count to your liking and use /dev/random instead of urandom if you are feeling truly paranoid.

Store passwords with something trustworthy.
SgtSpike
Legendary
*
Offline Offline

Activity: 1372
Merit: 1001



View Profile
August 16, 2011, 08:36:38 PM
 #3

RodeoX,

My guess is if I take the MD5 hash of every word in an English wordlist, plus every word with a single number after it I will have your passwords in that list. It should not take long to do that amount of hashing on a modern CPU.

Your scheme is better than using dictionary words but not by much.


I normally generate passwords with something like:
dd if=/dev/urandom bs=1 count=6 2>/dev/null | base64

One password per account as password reuse is evil. Adjust the count to your liking and use /dev/random instead of urandom if you are feeling truly paranoid.

Store passwords with something trustworthy.

BUT, that assumes that the password hacker knows that he is using an md5 hash for his password.  So few people would actually store their passwords in such a manner that it would not be worth it for a generic brute-force program to attempt to break into a passwords list by using a prehashed list like that.  The only way it would be insecure is if it was a targeted attack against a known subject who was known to be using such a password storage method.  Like the OP.

Basically, it's very secure (IMO), as long as you don't announce to the world that you're using it.
nmat
Hero Member
*****
Offline Offline

Activity: 602
Merit: 500


View Profile
August 16, 2011, 09:45:17 PM
 #4

BUT, that assumes that the password hacker knows that he is using an md5 hash for his password.  So few people would actually store their passwords in such a manner that it would not be worth it for a generic brute-force program to attempt to break into a passwords list by using a prehashed list like that.  The only way it would be insecure is if it was a targeted attack against a known subject who was known to be using such a password storage method.  Like the OP.

Basically, it's very secure (IMO), as long as you don't announce to the world that you're using it.

You are right, but I wouldn't use this with simple english words. Adding md5 of dictionary words to a wordlist is easy and it doesn't take that long to test.
It is a nice method, but use a fairly good password with it.

Anyway, I propose an improvement because some stupid websites still require that you use a password with upper letters, lower letters, numbers and signs regardless of how long your password is:

Quote
$ echo -n c00l_password! | md5sum | awk '{printf $1}' | base64
NWY0ZWVmMzRmZTM3YmU5MDlhNmRiNzc1NWFkMzk2NDA=

  • Using base64 after md5 guarantees the = sign at the end
  • It is a little longer and it is more unlikely that it will be at included in any wordlist
  • md5sum outputs '-' so I have to use that ugly awk
herzmeister
Legendary
*
Offline Offline

Activity: 1764
Merit: 1000



View Profile WWW
August 16, 2011, 10:39:53 PM
 #5


BUT, that assumes that the password hacker knows that he is using an md5 hash for his password.

[...]

Basically, it's very secure (IMO), as long as you don't announce to the world that you're using it.

Such an approach is known as Security through obscurity and not very recommended.

https://localbitcoins.com/?ch=80k | BTC: 1LJvmd1iLi199eY7EVKtNQRW3LqZi8ZmmB
SgtSpike
Legendary
*
Offline Offline

Activity: 1372
Merit: 1001



View Profile
August 16, 2011, 11:04:00 PM
 #6


BUT, that assumes that the password hacker knows that he is using an md5 hash for his password.

[...]

Basically, it's very secure (IMO), as long as you don't announce to the world that you're using it.

Such an approach is known as Security through obscurity and not very recommended.
That's like saying your password isn't secure if you post it on a forum.  Roll Eyes  I HIGHLY doubt any hackers are seriously going to add MD5 hashes (or other hashes) of dictionary words to their "check if this is their password" list, much less an even longer list of all of the typical dictionary items that they probably use to check password lists, much less an even longer list of all of those typical dictionary items that they use in all known hashed forms.  I'd give far better chances to me forgetting my own password because it is too complex than a hacker finding out what it is.

I mean, would you go to the MtGox password list and attempt to find someone who used an MD5 hash of a dictionary word as their password (which would have subsequently been stored as md5(md5(word)))?  Probably not.  You'd probably start with dictionary words, then go with dictionary words + numbers, then go with dictionary words + dictionary words, etc.  There's going to be a lot better chances of going through a lot of other lists (heck, even random alphanumeric characters) of finding the correct password than there would be of going through an MD5 hash list.

Now I'm not saying one should use a simple MD5-hashed dictionary word as their password, but perhaps whatever is the most complicated "memorable" password with an MD5 hash would be best.  Something like Tails4Thew1n, in MD5 hash form, and no dictionary attack is going to get it.

Call it security through obscurity all you want, but it would work, and it would work a heck of a lot better than people using (and losing) their 64 random character combinations.
captainteemo
Full Member
***
Offline Offline

Activity: 145
Merit: 100


View Profile
August 16, 2011, 11:16:58 PM
 #7

Use bcrypt()+SHA512 or something. MD5 is far too short.
RodeoX
Legendary
*
Online Online

Activity: 2660
Merit: 1049


The revolution will be monetized!


View Profile
August 16, 2011, 11:20:24 PM
 #8

Good points all around. My method assumes no one knows you are encoding a simple password. And yes, it would be better to use a non-word. Then an attacker must go the brut force route. The Md5 is long and complex enough to avoid being in the "low hanging fruit" category.

The main advantage is ease of use and relatively strong protection using an easy to remember PW. With a little creativity you can go further. Suppose I used the Md5 result string to hash it again?

The gospel according to Satoshi - https://bitcoin.org/bitcoin.pdf

Free bitcoin in AFRICA - https://bitcointalk.org/index.php?topic=2710325.msg27720734
ffuentes
Member
**
Offline Offline

Activity: 70
Merit: 10


Only a curious passer-by / FirstBits: 13zsc1


View Profile WWW
August 16, 2011, 11:20:58 PM
 #9

That trick is ok, but your easy password should not be a dictionary word. Dictionary words, specially english words are very well knowed.

Listen Radio Libre (Electronica) Donate. (click for details).

Chilean peso VS BTC ahora: http://irage.ca/2btc.php?a=1&c=CLP&r=1

My bitcoin address
captainteemo
Full Member
***
Offline Offline

Activity: 145
Merit: 100


View Profile
August 16, 2011, 11:23:42 PM
 #10

Good points all around. My method assumes no one knows you are encoding a simple password. And yes, it would be better to use a non-word. Then an attacker must go the brut force route. The Md5 is long and complex enough to avoid being in the "low hanging fruit" category.

The main advantage is ease of use and relatively strong protection using an easy to remember PW. With a little creativity you can go further. Suppose I used the Md5 result string to hash it again?


It's still lowercase az09 of the same length.

Run a SHA512 string through base64 or something, or even gzip it and use that as a completely untypable password
SgtSpike
Legendary
*
Offline Offline

Activity: 1372
Merit: 1001



View Profile
August 16, 2011, 11:57:04 PM
 #11

That trick is ok, but your easy password should not be a dictionary word. Dictionary words, specially english words are very well knowed.
c2e055acd7ea39b9762acfa672a74136

GO!
EDIT:  Lol, I googled it and the first result was correct.  Point taken.  Wink

Good points all around. My method assumes no one knows you are encoding a simple password. And yes, it would be better to use a non-word. Then an attacker must go the brut force route. The Md5 is long and complex enough to avoid being in the "low hanging fruit" category.

The main advantage is ease of use and relatively strong protection using an easy to remember PW. With a little creativity you can go further. Suppose I used the Md5 result string to hash it again?


It's still lowercase az09 of the same length.

Run a SHA512 string through base64 or something, or even gzip it and use that as a completely untypable password
I suppose it depends what sort of item/object/etc you are securing.  Not everything needs to be fort knox...
helloworld
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250



View Profile
August 18, 2011, 07:44:29 AM
 #12

Good points all around. My method assumes no one knows you are encoding a simple password. And yes, it would be better to use a non-word. Then an attacker must go the brut force route. The Md5 is long and complex enough to avoid being in the "low hanging fruit" category.

The main advantage is ease of use and relatively strong protection using an easy to remember PW. With a little creativity you can go further. Suppose I used the Md5 result string to hash it again?


Also a brute force attacker would have to know exactly how many iterations you used... what if you put that md5 back in 2 or 3 times for a new md5?
sd
Hero Member
*****
Offline Offline

Activity: 730
Merit: 500



View Profile
August 18, 2011, 08:18:47 AM
 #13


Also a brute force attacker would have to know exactly how many iterations you used... what if you put that md5 back in 2 or 3 times for a new md5?


Yes, it would be impractical to perform multiple rounds of MD5 hashing due to the computational difficulty of MD5.

Lets just check that:

function md5 {
echo -n $1 | md5sum | awk '{print $1}'
}

$ time md5 $(md5 $(md5 $(md5 $(md5 $(md5 $(md5 $(md5 $(md5 $(md5 'password' )))))))))
e36b70041d8f1609aa40b9ebba4363cf

real   0m0.084s
user   0m0.004s
sys   0m0.008s

That's on a laptop with the CPU throttled down to 800Mhz and coded in bash.
RodeoX
Legendary
*
Online Online

Activity: 2660
Merit: 1049


The revolution will be monetized!


View Profile
August 18, 2011, 01:32:53 PM
 #14


Also a brute force attacker would have to know exactly how many iterations you used... what if you put that md5 back in 2 or 3 times for a new md5?


Yes, it would be impractical to perform multiple rounds of MD5 hashing due to the computational difficulty of MD5.

Lets just check that:

function md5 {
echo -n $1 | md5sum | awk '{print $1}'
}

$ time md5 $(md5 $(md5 $(md5 $(md5 $(md5 $(md5 $(md5 $(md5 $(md5 'password' )))))))))
e36b70041d8f1609aa40b9ebba4363cf

real   0m0.084s
user   0m0.004s
sys   0m0.008s

That's on a laptop with the CPU throttled down to 800Mhz and coded in bash.

It's not even that hard.
There are like 80k words in common use in English. You could just create dictionaries that contain the Md5 values in advance. so six dictionaries could cover words plus up to five sums.
But again, you now have a targeted attack. That is a different beast. You would likely be hit by an additional targeted dictionary with your birthday, dog's name ect.

This method is for the person about to choose "password" as their password.

The gospel according to Satoshi - https://bitcoin.org/bitcoin.pdf

Free bitcoin in AFRICA - https://bitcointalk.org/index.php?topic=2710325.msg27720734
nmat
Hero Member
*****
Offline Offline

Activity: 602
Merit: 500


View Profile
August 18, 2011, 02:00:31 PM
 #15

Maybe I should create my own hash function... Just in case  Cool
wknight
Legendary
*
Offline Offline

Activity: 888
Merit: 1000


Bitcoin calls me an Orphan


View Profile WWW
August 18, 2011, 05:15:02 PM
 #16

If your looking for a great way to do passwords.. Password Haystacks is a great way to start.

This way you can use something you can remember and salt it to make it long enough to make it hard to figure out.

https://www.grc.com/haystack.htm

Mining Both Bitcoin and Litecoin.
jackjack
Legendary
*
Offline Offline

Activity: 1134
Merit: 1012


May Bitcoin be touched by his Noodly Appendage


View Profile
August 18, 2011, 05:34:34 PM
 #17

sha256 of a file, nothing to remember, impossible to find

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
August 18, 2011, 05:42:57 PM
 #18

This is my favorite way of doing passwords now.

http://passphra.se/

It was inspired by an xckd comic (which was inspired by another article, I think). http://xkcd.com/936/

helloworld
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250



View Profile
August 19, 2011, 01:55:25 AM
 #19

This is my favorite way of doing passwords now.

http://passphra.se/

It was inspired by an xckd comic (which was inspired by another article, I think). http://xkcd.com/936/

Whenever someone mentions 'password' and links to xkcd, I expect to see the $5-wrench comic.
fiatpirate
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
August 19, 2011, 02:35:57 AM
 #20

For those suggesting multiple hashes and such, I would think that a good phrase with mixed case and symbols may be easy enough and secure enough. You need supercomputers greater than are made today to crack a password constructed that way.

Just be smart, do it unexpected. Don't use a common phrase (use a derivative of it instead).
leeloulee
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile
August 19, 2011, 05:14:10 AM
 #21

yeh

SGT longdong
lazycodre
Newbie
*
Offline Offline

Activity: 25
Merit: 0


GO BTC!


View Profile
September 04, 2011, 07:47:33 PM
 #22

yeh

I'll quote that just for fun!
TeaL
Jr. Member
*
Offline Offline

Activity: 55
Merit: 0



View Profile
September 04, 2011, 08:14:53 PM
 #23

Using a hash of a password as a password is great if someone is trying generic brute-forcing tactics. Where it fails (as mentioned) is against a dictionary specifically built to use the hashed values of common words etc.. If you want to use a hash as a password (which you shouldn't as you limit yourself to Hex characters), you'd be better off using the hash of a file.

For example, lets say I have a file I keep just for this purpose (keep a backup obviously), I can take a hash of this file and use it as a password without fear of someone compiling a dictionary with that in it.

Try the following using the openssl library (works on Mac OS X).

Code:
openssl md5 PATH_TO_FILE

This should return you md5 hash of the file you selected.

Additionally, md5 password hashs can be broken fairly easily. With my 2 6990s I can pull 18Ghash/s in Whitepixel (that's 18 Billion password attempts per second).

To live is the rarest thing in the world, most people simply exist.
Helpful? ~ 1D3674hkatc4qQBjioWniF6epCmvAEQ45S
https://deepbit.net/userbar/4de68def8161972437000002_f1c525313c.png (https://deepbit.net)
Free as in Freedom.
ffuentes
Member
**
Offline Offline

Activity: 70
Merit: 10


Only a curious passer-by / FirstBits: 13zsc1


View Profile WWW
September 05, 2011, 09:32:35 PM
 #24

Using a hash of a password as a password is great if someone is trying generic brute-forcing tactics. Where it fails (as mentioned) is against a dictionary specifically built to use the hashed values of common words etc.. If you want to use a hash as a password (which you shouldn't as you limit yourself to Hex characters), you'd be better off using the hash of a file.

For example, lets say I have a file I keep just for this purpose (keep a backup obviously), I can take a hash of this file and use it as a password without fear of someone compiling a dictionary with that in it.

Try the following using the openssl library (works on Mac OS X).

Code:
openssl md5 PATH_TO_FILE

This should return you md5 hash of the file you selected.

Additionally, md5 password hashs can be broken fairly easily. With my 2 6990s I can pull 18Ghash/s in Whitepixel (that's 18 Billion password attempts per second).

What do you recommend? Another kind of hash?

Listen Radio Libre (Electronica) Donate. (click for details).

Chilean peso VS BTC ahora: http://irage.ca/2btc.php?a=1&c=CLP&r=1

My bitcoin address
Bebop
Newbie
*
Offline Offline

Activity: 27
Merit: 0



View Profile
September 05, 2011, 09:55:42 PM
 #25

If people used your MD5 tecnique without *advertising* it on forums, it might be safe. If you spead the word and advertise this tecnique to the point that it becomes popular (is this not the idea of the thread?) then its a weak implementation of secuity -- and for all the effort you invested in stuffing around with the command console, you would have been better off selecting a password in the AAAAbbbb#1111 format and *not* worrying about MD5.

★ The cure for boredom is curiosity
runeks
Legendary
*
Offline Offline

Activity: 952
Merit: 1000



View Profile WWW
September 05, 2011, 11:26:29 PM
 #26

Another way to create good-security and fairly easily remembered passwords in linux is using this command:

Code:
shuf -n <num-words> --random-source=/dev/urandom /usr/share/dict/words

where <num-words> is the number of dictionary words you want your password to consist of. My /usr/share/dict/words has about 98,000 words, which gives 16 bits of entropy per word. So let's say I create a password with 5 random words from this dictionary:

Code:
rune@runescomp:~$ shuf -n 5 --random-source=/dev/urandom /usr/share/dict/words
unwound
marrowing
jockey
illusion's
sacrament

I now have the password unwoundmarrowingjockeyillusion'ssacrament which has 80 bits of entropy, and isn't impossible to remember.
80 bits of entropy gives us about 10²⁴ possible combinations. Provided that passwords are stored as their MD5 hash and an attacker got hold of the MD5 hash (and he knew that he had to find five words from this particular dictionary), it'd take him about one millions years to finish, using 4 x HD 5970 graphics cards.

Of course, you can always choose fewer words, or use a dictionary that doesn't have words like "Ångström" and "prophylaxis". This could lower the entropy but make the passwords more easily rememberable. For example using six words from the Diceware wordlist, which would give you 78 bits of entropy but an easier to remember password.
RodeoX
Legendary
*
Online Online

Activity: 2660
Merit: 1049


The revolution will be monetized!


View Profile
September 06, 2011, 02:16:08 PM
 #27

Great thoughts here guys! I especially like the idea of using the Md5 of a file only you know. Kinda like the car CD players that only unlock when you put in the correct music CD. 

The gospel according to Satoshi - https://bitcoin.org/bitcoin.pdf

Free bitcoin in AFRICA - https://bitcointalk.org/index.php?topic=2710325.msg27720734
Tarlusk
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
September 07, 2011, 08:16:27 PM
 #28

This is my favorite way of doing passwords now.

http://passphra.se/

It was inspired by an xckd comic (which was inspired by another article, I think). http://xkcd.com/936/

I would suggest using this website instead.

http://world.std.com/~reinhold/diceware.html
http://world.std.com/~reinhold/diceware.wordlist.asc

It does essentially the same thing, except that you do it yourself with a six-sided die.
That way your new password doesn't get sent over the internet in plaintext, and you don't have to trust the website that generated it.
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
September 30, 2011, 06:11:39 AM
 #29

This is my favorite way of doing passwords now.

http://passphra.se/

It was inspired by an xckd comic (which was inspired by another article, I think). http://xkcd.com/936/

I would suggest using this website instead.

http://world.std.com/~reinhold/diceware.html
http://world.std.com/~reinhold/diceware.wordlist.asc

It does essentially the same thing, except that you do it yourself with a six-sided die.
That way your new password doesn't get sent over the internet in plaintext, and you don't have to trust the website that generated it.

It's javascript. The only thing sent over the internet is the giant word list. The passwords are generated client side.

Pages: 1 2 [All]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!