SHA1 Decryption!!

G

Gormare Kalss

Hello! I hope that no one will be offended by this question!! Ive been
reading the post regarding the subject sha1 hashing and there are quite
a few.
But i wonder if this is possible to figure out??
I have this coordinate and i need to figure it out. I need to get the
number for xxx and yyy. Is it possible to reverse this hash if I know
parts of the string?
("N59 52.xxx E017 42.yyy") = c884efef7c92e8095d2dd06ce8e02826dcf05a3e
 
G

Gormare Kalss

Matthew Bloch wrote in post #987597:
It's probably feasible to try every combination of xxx and yyy, even in
Ruby (though it'd go a lot faster in C). If those are definitely
digits, there's only 1 million :) Knowing more about the data might
also help you rule out which values of xxx and yyy aren't feasible.

One says yes and one says no :) I havent got got a clue how to do it but
data for either xxx and yyy are between 001-999 so about a million
chances.. :) Nice to find an example somewhere..
 
B

Brian Candler

Ben Bleything wrote in post #987607:
Everybody is saying the same thing. It's not possible to "decrypt" a
cryptographic hash. It *is* possible to bruteforce, but it may be very
time-consuming.

Not very in this case.


brian@zino:~$ cat dehash.rb
require 'digest/sha1'
TARGET = "c884efef7c92e8095d2dd06ce8e02826dcf05a3e"
1000.times do |i|
1000.times do |j|
if Digest::SHA1.hexdigest("N59 52.%03d E017 42.%03d" % [i,j]) ==
TARGET
raise "Whoo! #{i} #{j}"
end
end
end
brian@zino:~$ time ruby dehash.rb
dehash.rb:6: Whoo! 65 988 (RuntimeError)
from dehash.rb:4:in `times'
from dehash.rb:4
from dehash.rb:3:in `times'
from dehash.rb:3

real 0m0.839s
user 0m0.820s
sys 0m0.010s
 
A

Aaron D. Gifford

Now if only it had been a location more interesting than a road in
Sweden. =A0(Of course to the original poster it is obviously of
interest.)

Amend that: A wood or small forest in Sweden. (I repeatedly forget
that Google Maps tries to find the nearest point on a road when
coordinates are searched for.)

Aaron out.


http://maps.google.com/maps?f=3Dq&source=3Ds_q&hl=3Den&geocode=3D&q=3DN59+5=
2.065+E017+42.988&aq=3D&sll=3D37.0625,-95.677068&sspn=3D42.631141,84.814453=
&ie=3DUTF8&ll=3D59.867785,17.716613&spn=3D0.000828,0.002588&t=3Dh&z=3D19&iw=
loc=3Dnear
 
N

Nick Klauer

[Note: parts of this message were removed to make it a legal post.]

Or the location of a safehouse from a stalker... of course, unlikely, but
since nobody bothered to ask, it's probably not that important... :)


-Nick Klauer
 
B

botp

One says yes and one says no :) I havent got got a clue how to do it but
data for either xxx and yyy are between 001-999 so about a million
chances.. :) Nice to find an example somewhere..

you can loop it for that string w x & y combi

i did a nested loop for that string alone and got

$ time ruby test_sha1_digest_loop.rb | grep
c884efef7c92e8095d2dd06ce8e02826dcf05a3e
065 988 c884efef7c92e8095d2dd06ce8e02826dcf05a3e

real 0m6.897s
user 0m11.970s
sys 0m0.170s


rechecking in irb,

require 'digest/sha1'
#=> true
Digest::SHA1.hexdigest "N59 52.065 E017 42.988"
#=> "c884efef7c92e8095d2dd06ce8e02826dcf05a3e"


best regards -botp
 
A

Albert Schlef

Brian Candler wrote in post #987608:
1000.times do |i|
1000.times do |j|
if Digest::SHA1.hexdigest("N59 52.%03d E017 42.%03d" % [i,j]) == TARGET
raise "Whoo! #{i} #{j}"

You can't do this: there might be another location with the same hash.
You have to prove (mathematically) that no two locations can have the
same SHA1 hash.
 
J

John Feminella

You can't do this: there might be another location with the same hash.
You have to prove (mathematically) that no two locations can have the
same SHA1 hash.

The probability of this occurring is vanishingly small: the number of
possibilities is much less than the keyspace. Avoiding collisions is a
hallmark of robust hashing.

~ jf
--
John Feminella
Principal Consultant, BitsBuilder
LI: http://www.linkedin.com/in/johnxf
SO: http://stackoverflow.com/users/75170/



Brian Candler wrote in post #987608:
1000.times do |i|
=C2=A0 1000.times do |j|
=C2=A0 =C2=A0 if Digest::SHA1.hexdigest("N59 52.%03d E017 42.%03d" % [i,= j]) =3D=3D TARGET
=C2=A0 =C2=A0 =C2=A0 raise "Whoo! #{i} #{j}"

You can't do this: there might be another location with the same hash.
You have to prove (mathematically) that no two locations can have the
same SHA1 hash.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top