Skip to main content
mention simpler method to base64 code
Source Link
MikeW
  • 240
  • 3
  • 8

You will find the answers to many of your questions (with examples) here:

https://www.madboa.com/geek/openssl/

In particular, if you are sending the encrypted result from your procedure via email, you might wish to base64 encode it using either the '-a' option in 'enc' subcommand, or as a separate step, the 'base64' openssl subcommand.

This will then produce a result that is ASCII text rather than a binary file of unprintable bytes !.

I would suggest that you check your encryption by first of all, creating your own (test) RSA keyfile (also using openssl, see link above), and then trying the 'round trip' of encrypting-(base64)encoding-decoding-decrypting.

If your result using your own test RSA key (pair) is the same as what you put in, then it's reasonable to say that at least you have the mechanics all correct.

You could then try sending some other text to your intended recipient using the supplied RSA key file to verify all is correct, prior to sending your "real" data - which I hope is not the same as you have typed in your question ! (unless you are just using encryption for authentication).

You will find the answers to many of your questions (with examples) here:

https://www.madboa.com/geek/openssl/

In particular, if you are sending the encrypted result from your procedure via email, you might wish to base64 encode it using the 'base64' openssl subcommand.

This will then produce a result that is ASCII text rather than a binary file of unprintable bytes !

I would suggest that you check your encryption by first of all, creating your own (test) RSA keyfile (also using openssl, see link above), and then trying the 'round trip' of encrypting-(base64)encoding-decoding-decrypting.

If your result using your own test RSA key (pair) is the same as what you put in, then it's reasonable to say that at least you have the mechanics all correct.

You could then try sending some other text to your intended recipient using the supplied RSA key file to verify all is correct, prior to sending your "real" data - which I hope is not the same as you have typed in your question ! (unless you are just using encryption for authentication).

You will find the answers to many of your questions (with examples) here:

https://www.madboa.com/geek/openssl/

In particular, if you are sending the encrypted result from your procedure via email, you might wish to base64 encode it using either the '-a' option in 'enc' subcommand, or as a separate step, the 'base64' openssl subcommand.

This will then produce a result that is ASCII text rather than a binary file of unprintable bytes.

I would suggest that you check your encryption by first of all, creating your own (test) RSA keyfile (also using openssl, see link above), and then trying the 'round trip' of encrypting-(base64)encoding-decoding-decrypting.

If your result using your own test RSA key (pair) is the same as what you put in, then it's reasonable to say that at least you have the mechanics all correct.

You could then try sending some other text to your intended recipient using the supplied RSA key file to verify all is correct, prior to sending your "real" data - which I hope is not the same as you have typed in your question ! (unless you are just using encryption for authentication).

Source Link
MikeW
  • 240
  • 3
  • 8

You will find the answers to many of your questions (with examples) here:

https://www.madboa.com/geek/openssl/

In particular, if you are sending the encrypted result from your procedure via email, you might wish to base64 encode it using the 'base64' openssl subcommand.

This will then produce a result that is ASCII text rather than a binary file of unprintable bytes !

I would suggest that you check your encryption by first of all, creating your own (test) RSA keyfile (also using openssl, see link above), and then trying the 'round trip' of encrypting-(base64)encoding-decoding-decrypting.

If your result using your own test RSA key (pair) is the same as what you put in, then it's reasonable to say that at least you have the mechanics all correct.

You could then try sending some other text to your intended recipient using the supplied RSA key file to verify all is correct, prior to sending your "real" data - which I hope is not the same as you have typed in your question ! (unless you are just using encryption for authentication).