Bitcoin Forum
October 18, 2017, 08:31:45 PM *
News: Latest stable version of Bitcoin Core: 0.15.0.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Cracking 7zip file you have the pass to.. Almost.?  (Read 1576 times)
bitjet
Hero Member
*****
Offline Offline

Activity: 642



View Profile
October 19, 2012, 07:59:28 PM
 #1

Hey guys Im trying to unzip a file with a 40char password. I have the password but the capitalization and possily order of the phrasing is unknown all manual entry tries have failed. Would it even be possible to crack this file under 256it encryption? Even with 99.9% of the passphrase is known?

CENTRA

            ▄▄▄██████████▄▄▄
        ▄▄████████████████████▄▄
      ▄███████▀▀         ▀▀███████▄
    ▄█████▀                  ▀██████
   █████▀      ▄▄▄█████▄▄      ▀█████▄
  █████     ▄██████████████▄     ▀████▄
 █████     ██████▀▀  ▀▀██████▄    ▀████
▐████     █████          █████     █████
█████    ▐████                     ▐████
█████    █████                     ▐████
█████     █████          ▄████▌    █████
 ████▌    ▀█████▄▄    ▄▄█████▀    ▄████▌
 ▀████▄     ▀██████████████▀     ▄████▀
  ▀█████▄     `▀████████▀▀     ▄█████▀
   `██████▄                  ▄██████
     ▀███████▄▄          ▄▄███████▀
       ▀██████████████████████▀
           ▀▀▀█████████████▀▀

.
.
.
.
1508358705
Hero Member
*
Offline Offline

Posts: 1508358705

View Profile Personal Message (Offline)

Ignore
1508358705
Reply with quote  #2

1508358705
Report to moderator
1508358705
Hero Member
*
Offline Offline

Posts: 1508358705

View Profile Personal Message (Offline)

Ignore
1508358705
Reply with quote  #2

1508358705
Report to moderator
1508358705
Hero Member
*
Offline Offline

Posts: 1508358705

View Profile Personal Message (Offline)

Ignore
1508358705
Reply with quote  #2

1508358705
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
SgtSpike
Legendary
*
Offline Offline

Activity: 1358



View Profile
October 19, 2012, 08:22:18 PM
 #2

EDIT:  My maths skills fail at life today.  Will be back tomorrow.
bitjet
Hero Member
*****
Offline Offline

Activity: 642



View Profile
October 19, 2012, 08:37:40 PM
 #3

Well, if capitalization is completely unknown and potentially truly random, that's 2^40 of entropy right there.  Even if you're doing 1 billion attempts a second (no idea if that's possible), you'd still have 2^31 seconds to complete it, or about 68 years.

Actually the capitalization is somewhat known. there are several words in the passphrase. The first letter in each word is either capitalized or not.

CENTRA

            ▄▄▄██████████▄▄▄
        ▄▄████████████████████▄▄
      ▄███████▀▀         ▀▀███████▄
    ▄█████▀                  ▀██████
   █████▀      ▄▄▄█████▄▄      ▀█████▄
  █████     ▄██████████████▄     ▀████▄
 █████     ██████▀▀  ▀▀██████▄    ▀████
▐████     █████          █████     █████
█████    ▐████                     ▐████
█████    █████                     ▐████
█████     █████          ▄████▌    █████
 ████▌    ▀█████▄▄    ▄▄█████▀    ▄████▌
 ▀████▄     ▀██████████████▀     ▄████▀
  ▀█████▄     `▀████████▀▀     ▄█████▀
   `██████▄                  ▄██████
     ▀███████▄▄          ▄▄███████▀
       ▀██████████████████████▀
           ▀▀▀█████████████▀▀

.
.
.
.
SgtSpike
Legendary
*
Offline Offline

Activity: 1358



View Profile
October 19, 2012, 08:46:30 PM
 #4

Well, if capitalization is completely unknown and potentially truly random, that's 2^40 of entropy right there.  Even if you're doing 1 billion attempts a second (no idea if that's possible), you'd still have 2^31 seconds to complete it, or about 68 years.

Actually the capitalization is somewhat known. there are several words in the passphrase. The first letter in each word is either capitalized or not.
And the order of the words is unknown?  Any other unknowns?  How many words?
bitjet
Hero Member
*****
Offline Offline

Activity: 642



View Profile
October 19, 2012, 09:07:48 PM
 #5

Oder of the words is semi know, the first two are known adnt the last word is known how it all fits together is not. nothing is actually missing, just the possible combinations.

5 phrases. they are numbers followed by a word.

CENTRA

            ▄▄▄██████████▄▄▄
        ▄▄████████████████████▄▄
      ▄███████▀▀         ▀▀███████▄
    ▄█████▀                  ▀██████
   █████▀      ▄▄▄█████▄▄      ▀█████▄
  █████     ▄██████████████▄     ▀████▄
 █████     ██████▀▀  ▀▀██████▄    ▀████
▐████     █████          █████     █████
█████    ▐████                     ▐████
█████    █████                     ▐████
█████     █████          ▄████▌    █████
 ████▌    ▀█████▄▄    ▄▄█████▀    ▄████▌
 ▀████▄     ▀██████████████▀     ▄████▀
  ▀█████▄     `▀████████▀▀     ▄█████▀
   `██████▄                  ▄██████
     ▀███████▄▄          ▄▄███████▀
       ▀██████████████████████▀
           ▀▀▀█████████████▀▀

.
.
.
.
BC12345
Jr. Member
*
Offline Offline

Activity: 57


View Profile
October 19, 2012, 09:15:14 PM
 #6

windows or linux?
Pieter Wuille
Legendary
*
Offline Offline

Activity: 1050


View Profile WWW
October 19, 2012, 10:25:28 PM
 #7

Well, if capitalization is completely unknown and potentially truly random, that's 2^40 of entropy right there.  Even if you're doing 1 billion attempts a second (no idea if that's possible), you'd still have 2^31 seconds to complete it, or about 68 years.

Heh?

2^40 / 1000000000 = 1100s.

aka sipa, core dev team

Tips and donations: 1KwDYMJMS4xq3ZEWYfdBRwYG2fHwhZsipa
SgtSpike
Legendary
*
Offline Offline

Activity: 1358



View Profile
October 19, 2012, 11:04:03 PM
 #8

Well, if capitalization is completely unknown and potentially truly random, that's 2^40 of entropy right there.  Even if you're doing 1 billion attempts a second (no idea if that's possible), you'd still have 2^31 seconds to complete it, or about 68 years.

Heh?

2^40 / 1000000000 = 1100s.

MATHS FAIL.

Will update my post.
bitjet
Hero Member
*****
Offline Offline

Activity: 642



View Profile
October 19, 2012, 11:47:53 PM
 #9

Its a 7zip exe archive on windows. If I could feed it a library and let it fiill in the holes that would be awesome I have 3.5gh to put towards it.

CENTRA

            ▄▄▄██████████▄▄▄
        ▄▄████████████████████▄▄
      ▄███████▀▀         ▀▀███████▄
    ▄█████▀                  ▀██████
   █████▀      ▄▄▄█████▄▄      ▀█████▄
  █████     ▄██████████████▄     ▀████▄
 █████     ██████▀▀  ▀▀██████▄    ▀████
▐████     █████          █████     █████
█████    ▐████                     ▐████
█████    █████                     ▐████
█████     █████          ▄████▌    █████
 ████▌    ▀█████▄▄    ▄▄█████▀    ▄████▌
 ▀████▄     ▀██████████████▀     ▄████▀
  ▀█████▄     `▀████████▀▀     ▄█████▀
   `██████▄                  ▄██████
     ▀███████▄▄          ▄▄███████▀
       ▀██████████████████████▀
           ▀▀▀█████████████▀▀

.
.
.
.
BC12345
Jr. Member
*
Offline Offline

Activity: 57


View Profile
October 20, 2012, 12:09:03 AM
 #10

I am not sure if I understand what your passphrase looks like, could you give an example?

Does it look like this:

"1234(P/p)eter 1234(P/p)aul 1234(M/m)arry 1234(M/m)olly 1234(B/b)aby"

?


Edit:
If it looks like this and you are sure that you know the first, second and last word (except the capitalization) then there are only 64 possible combinations;

             2           *          2       *    (     4          *         2   )       *         2                =      64

In  this case I would suggest that you make a list of all combinations and try them manually. (I hope my math was correct here)
ralree
Hero Member
*****
Offline Offline

Activity: 518


Manateeeeeeees


View Profile
October 20, 2012, 01:42:34 AM
 #11

Code:
#!/usr/bin/env python
import string
mystr="peter piper picked a peck of pickled peppers"

def gen(s):
  words = s.split()
  for word in words:
    yield s
    repl = string.capitalize(word)
    s = string.replace(s, word, repl)
    yield s

combinations = gen(mystr)
for i in combinations:
  print i

Output:

Code:
peter piper picked a peck of pickled peppers
Peter piper picked a peck of pickled peppers
Peter piper picked a peck of pickled peppers
Peter Piper picked a peck of pickled peppers
Peter Piper picked a peck of pickled peppers
Peter Piper Picked a peck of pickled peppers
Peter Piper Picked a peck of pickled peppers
Peter Piper Picked A peck of pickled peppers
Peter Piper Picked A peck of pickled peppers
Peter Piper Picked A Peck of pickled peppers
Peter Piper Picked A Peck of pickled peppers
Peter Piper Picked A Peck Of pickled peppers
Peter Piper Picked A Peck Of pickled peppers
Peter Piper Picked A Peck Of Pickled peppers
Peter Piper Picked A Peck Of Pickled peppers
Peter Piper Picked A Peck Of Pickled Peppers

Then it's just something like:

Code:
hank@shelob ~/tmp $ python foo.py | while read line; do echo 7z e somefile.7z -p\"$line\"; done
7z e somefile.7z -p"peter piper picked a peck of pickled peppers"
7z e somefile.7z -p"Peter piper picked a peck of pickled peppers"
7z e somefile.7z -p"Peter piper picked a peck of pickled peppers"
7z e somefile.7z -p"Peter Piper picked a peck of pickled peppers"
7z e somefile.7z -p"Peter Piper picked a peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked a peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked a peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck Of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck Of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck Of Pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck Of Pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck Of Pickled Peppers"

This doesn't use recursion, so it won't generate the power set of all capitalization combinations, but it should get you started..
I'm going to continue messing around with it to try and get all capitalization combinations - it's a fun problem!

1MANaTeEZoH4YkgMYz61E5y4s9BYhAuUjG
ralree
Hero Member
*****
Offline Offline

Activity: 518


Manateeeeeeees


View Profile
October 20, 2012, 02:12:36 AM
 #12

Fixed it:

Code:
#!/usr/bin/env python
import string
mystr="peter piper picked a peck of pickled peppers"

def gen_inner(s, words):
  if(len(words) > 1):
    gen_inner(s, words[1:])
  else:
    print s

  repl = string.capitalize(words[0])
  s = string.replace(s, words[0], repl)
  if(len(words) > 1):
    gen_inner(s, words[1:])
  else:
    print s

words = mystr.split()
gen_inner(mystr, words)

This generates ALL capitalization permutations of the given string.  Then you feed them in the same way as I showed in my previous post.

1MANaTeEZoH4YkgMYz61E5y4s9BYhAuUjG
BC12345
Jr. Member
*
Offline Offline

Activity: 57


View Profile
October 20, 2012, 03:27:48 PM
 #13

Nice!  Smiley
Pages: [1]
  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!