LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-25-2012, 01:27 PM   #1
bayanaa
LQ Newbie
 
Registered: May 2012
Posts: 13

Rep: Reputation: Disabled
smime encryption


First, I create a private/public key

openssl genrsa -out c.key 2048

Then, I extracted the public key because I want to encrypt a file using smime and this public key

openssl rsa -in c.key -pubout -out publickey.pem

But, this command doesn't produce file.enc

openssl smime -encrypt -in file.txt -out file.enc publickey.pem

plz, can anyone tell me what's the matter?
 
Old 05-25-2012, 03:27 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
There are two links that I suggest you look at:
1 - The OpenSSL How To Document here: http://www.madboa.com/geek/openssl/
It has many examples of using OpenSSL to encryt and decrypt a document.
2 - the smime man page here: http://www.openssl.org/docs/apps/smime.html

You will notice that the smime uses a PKCS12 format (PEM) for the key. Your RSA key is not in this format.
 
Old 05-25-2012, 03:57 PM   #3
bayanaa
LQ Newbie
 
Registered: May 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Noway2 View Post

You will notice that the smime uses a PKCS12 format (PEM) for the key. Your RSA key is not in this format.
Thank you

But, I extracted the public key in pem format from RSA key, and I use this public one in smime command .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SMIME certificate renewal FBergeron Linux - Software 2 03-29-2019 11:43 AM
Encryption pkraus109 Linux - Security 2 01-27-2010 11:35 PM
Linux password encryption and data encryption Tux-Slack Programming 4 06-20-2007 06:46 AM
Evolution and smime rogcar Linux - Software 0 09-07-2006 05:00 AM
Mandrake 9.0 Wireless Works without encryption.. does not with encryption topcat Linux - Wireless Networking 3 05-04-2003 08:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration