#1 [[Question]] Signing a Private RSA Key with SHA256 and a String?

Затворени
отворен преди 6 години от WammKD · 1 коментара
WammKD коментира преди 6 години

I was wondering if I'd be able to do as the subject line says with this library.

Namely, I'm trying to replicate some Ruby code: Base64.strict_encode64(keypair.sign(OpenSSL::Digest::SHA256.new, "string")). I'm, specifically, looking at the keypair.sign(OpenSSL::Digest::SHA256.new, "string") part, right now.

Is there a way to do that with this library?

Also of curiosity, does it provide Base64 as well? I worked on my own module of it not that long ago but I could just use this library's if I'm able to do the signing with it.

Thanks for any help!

I was wondering if I'd be able to do as the subject line says with this library. Namely, I'm trying to replicate some Ruby code: `Base64.strict_encode64(keypair.sign(OpenSSL::Digest::SHA256.new, "string"))`. I'm, specifically, looking at the `keypair.sign(OpenSSL::Digest::SHA256.new, "string")` part, right now. Is there a way to do that with this library? Also of curiosity, does it provide Base64 as well? I worked on my own module of it not that long ago but I could just use this library's if I'm able to do the signing with it. Thanks for any help!
civodul коментира преди 2 години
Сътрудник

It's veeery late, but yes, you can do that with this library.

To compute a hash, use sha256 from (guix hash), as in:

(use-modules (gcrypt hash) (rnrs bytevectors))

(sha256 (string->utf8 "Some string."))

And there's now a complete sign/verify example in the manual, in the "Public-Key Cryptography" section.

HTH!

It's veeery late, but yes, you can do that with this library. To compute a hash, use `sha256` from `(guix hash)`, as in: ```scheme (use-modules (gcrypt hash) (rnrs bytevectors)) (sha256 (string->utf8 "Some string.")) ``` And there's now a complete sign/verify example in the manual, in the "Public-Key Cryptography" section. HTH!
Впишете се за да се присъедините към разговора.
Няма етикет
Няма етап
Няма изпълнител
2 участника
Зареждане...
Отказ
Запис
Все още няма съдържание.