Results 1 to 2 of 2

Thread: openssl decrypt using private key

  1. #1
    Join Date
    May 2006
    Beans
    378
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Question openssl decrypt using private key

    Hi, I am having some problems decrypting a given string/file using openssl.

    I have used the command:
    Code:
    openssl rsautl -decrypt -in ciphertext -out plaintext -inkey private.pem
    but all I get is the following error:
    Code:
    RSA operation error
    20518:error:0406506C:rsa routines:RSA_EAY_PRIVATE_DECRYPT:data greater than mod len:rsa_eay.c:506:
    The ciphertext is a file conatining a string which looks to be in base64 format.
    Once the command has been run, with the error, a file is created called plaintext but it looks to be empty.
    Code:
    make me a sandwich
            no, make it yourself
    sudo make me a sandwich
            ok then...

  2. #2
    Join Date
    May 2006
    Beans
    378
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: openssl decrypt using private key

    Problem solved!

    Code:
    $ openssl enc -in ciphertext -out binarytext -d -a
    $ openssl rsautl -decrypt -in binarytext -out plaintext -inkey private.pem
    Code:
    make me a sandwich
            no, make it yourself
    sudo make me a sandwich
            ok then...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •