c - How to decrypt data using RSA public key? -
let me introduce problem, have *.crt file, contains der encoded x509 version 3 certificate. using asn1 der(libtomcrypt) decrypt data , save structure called x509v3. have message m, encrypted signature of m -> s(rsa encrypted), , public key -> p located inside x509 certificate(subject public key field). first must decrypt s using public key p, problem can't find api this?
looked libtomcrypt seems there no api takes public key( unsigned char * ) , encrypted data (also unsigned char *) , gives decrypted data( unsigned char *).
thanks help! p.s. sorry english;)
you 1 of countless victims of historical sloppy presentation of signatures, has created , still creates massive amounts of confusion.
what have signature , want verify it. there exist several signature algorithms, , 1 of them called "rsa" because looks similar asymmetric encryption algorithm called similar. rough description of rsa signatures "you encrypt private key" (i.e. taking encryption algorithm in "reverse" direction), why signatures described this... except not work this. asymmetric encryption rsa implies mathematical operation (modular exponentiation) @ core, "padding" important security; rsa signatures imply padding, quite distinct one.
so should not think signatures kind of encryption. confuse you.
in libtomcrypt, rsa signature verification function called rsa_verify_hash().
Comments
Post a Comment