• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Signature

 
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I have a String to which I want to assign a unique signature, then later check to see if that signature corresponds to that string or not.
I want to put everything in a URL.(say the string and its signature) so that when user click, I retrieve string + signature and see if this signature corresponds to that string.

I tried using this:


Do you know once we have the signature how can we chek that a string S corresponds to that signature ?
I also tried to use DSA encryption but to decrypte the signature you have to have the public key which I don't think is possible to put in a URL.

Please help.

Thank you.
 
author
Posts: 23958
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, this line won't work...



If I remember correctly, the toString() method of an array gives an "L", followed by the class name, followed by some reference number. It doesn't use the contents of the array to generate the string.

Another issue is that the md5 hash is binary -- it is not human readable, which is what you need to be part of a URL. You need some way to encode a string based on the bytes. Try google for either uuencode or base64 encode of java strings, for more information.

But to answer your question...


Do you know once we have the signature how can we chek that a string S corresponds to that signature ?
I also tried to use DSA encryption but to decrypte the signature you have to have the public key which I don't think is possible to put in a URL.



There is no way to convert an md5 hash back to the original string.

To confirm a signature, regenerate another signature from the string S (using the exact same md5 and base64 encoding). If the signature do not match the one recieved, then either the string or signature got corrupted in transit.

Henry
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic