SHA1 Decryption!

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

On Tue, Mar 15, 2011 at 7:07 PM, Gormare K. [email protected]
wrote:

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?

The whole point of hashing is that it is non-reversal. Without
brute-forcing (i.e. going through every possible permutation of
possible hash sources) it’s pretty much impossible to reverse anything
hashed.

Mind, there’s things like rainbow tables (for MD5, mostly), but those
“just” pre-compute the potential hashes that result from any given
input. That’s why hashing makes for good checksums, and a nice way to
store passwords without really storing them (especially when a salt is
used, making rainbow tables and brute force attacks infeasible).

TL;DR: No, it’s not possible to reverse a cryptographic hash.


Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.

On 15/03/11 18:07, Gormare K. wrote:

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

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 :slight_smile: Knowing more about the data might
also help you rule out which values of xxx and yyy aren’t feasible.

Matthew B. wrote in post #987597:

On 15/03/11 18:07, Gormare K. wrote:

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

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 :slight_smile: 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 :slight_smile: 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… :slight_smile: Nice to find an example somewhere…

On Tue, Mar 15, 2011 at 11:38 AM, Gormare K. [email protected]
wrote:

One says yes and one says no :slight_smile: 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… :slight_smile: Nice to find an example somewhere…

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.

Ben

On Tue, Mar 15, 2011 at 1:38 PM, Brian C. [email protected]
wrote:

dehash.rb:6: Whoo! 65 988 (RuntimeError)

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

Aaron out.

http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=N59+52.065+E017+42.988&aq=&sll=37.0625,-95.677068&sspn=42.631141,84.814453&ie=UTF8&ll=59.869533,17.70627&spn=0.003312,0.010353&t=h&z=17

Ben B. 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.

[email protected]:~$ 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
[email protected]:~$ 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:intimes’
from dehash.rb:3

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

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

-Nick K.

On Wed, Mar 16, 2011 at 2:38 AM, Gormare K. [email protected]
wrote:

One says yes and one says no :slight_smile: 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… :slight_smile: 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

Brian C. 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.

On Tue, Mar 15, 2011 at 6:31 PM, Aaron D. Gifford [email protected]
wrote:

Now if only it had been a location more interesting than a road in
Sweden. (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=q&source=s_q&hl=en&geocode=&q=N59+52.065+E017+42.988&aq=&sll=37.0625,-95.677068&sspn=42.631141,84.814453&ie=UTF8&ll=59.867785,17.716613&spn=0.000828,0.002588&t=h&z=19&iwloc=near

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 F.
Principal Consultant, BitsBuilder
LI: http://www.linkedin.com/in/johnxf
SO: http://stackoverflow.com/users/75170/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs