Article 51X4M question about OPENSSL SMIME encryption

question about OPENSSL SMIME encryption

by
piramiday
from LinuxQuestions.org on (#51X4M)
I'm encrypting a file using openssl smime, and I am noticing something that does not make sense to me.

first, I generate (only once!) a certificate based on my ssh rsa key, like so:
Code:openssl req -key ~/.ssh/id_rsa -new -x509 -nodes -subj '/' -out ~/.ssh/id_rsa.certhis command works as expected.

then, I encode my secret file.txt using such a certificate, like so:
Code:openssl smime -encrypt -aes256 -in file.txt -out file.txt.enc -outform PEM ~/.ssh/id_rsa.certhis command seemingly works as expected.

my problem is that, even though the plaintext file is unchanged, every time I execute the encrypt command I get a different cyphertext file -- does anybody know why this happens?
I was under the impression that, with the same certificate and the same secret file.txt, I would have reproduced exactly the same cyphertext file.txt.enc.
any help is appreciated!latest?d=yIl2AUoC8zA latest?i=TZlFhCUvDp4:EPNYpe2BajQ:F7zBnMy latest?i=TZlFhCUvDp4:EPNYpe2BajQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=TZlFhCUvDp4:EPNYpe2BajQ:gIN9vFwTZlFhCUvDp4
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments