• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to extract the SHA-1 digest from an encrypted signature?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm trying to extract the SHA-1 digest from a SHA1withRSA signature value. Given that I have the X.509 certificate, which means that I can extract the X.509 public key, and given that I have the signature value, computed using RSA over the SHA-1 digest value, how can I extract back the SHA-1 digest value?

Regards,

Fuad Abinader
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A digest is not a cipher - it is a one-way algorithm. Once something is digested, there is no way to get back the original data.
 
Fuad Abinader
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I didn't explain the case correctly: I don't want to obtain the original value that the SHA-1 digest represents, but the digest value itself which is coded on a RSA signature. I mean, I have this encrypted value (the RSA signature) which was generated based on a value (the SHA-1 digest value), and from the public key and the encrypted value, I want to obtain back the decrypted value. Any hints on how to do that?

Also, I'm having problems ensuring the validity of the signature value against the certificate. I'm using the following code:

, but this always return , no matter if the signature is valid against the certificate or not. Any hints on that too?

Regards,

Fuad Abinader
 
Hug your destiny! And hug this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic