RSA encryption/decryption doesn't restore original value when given message starts with 0
Issue #98
resolved
This should return #vu8(0 0 0 1)
(import (rnrs)
(crypto))
(define keypair (generate-key-pair RSA))
(define msg #vu8(0 0 0 1))
(let ((enc-ci (cipher RSA (keypair-public keypair) :padding #f))
(dec-ci (cipher RSA (keypair-private keypair) :padding #f)))
(decrypt dec-ci (encrypt enc-ci msg)))
But return s #vu8(0)
Comments (2)
-
reporter -
reporter - changed status to resolved
Modified not to strip leading 0 when RSA cipher uses padding. (Fixes
#98)→ <<cset b3caeef9430c>>
- Log in to comment
Bouncy Castle returns
#vu8(1)
with nopadding. This seems kind of inevitable. All what we can do is that ensuring to return proper value when padding is specified. Thus it should also return#vu8(1)
if it's not padded.