LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 11-29-2012, 11:06 AM   #1
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 179

Rep: Reputation: 24
Arrow Unable to load Public Key (OpenSSL RSA, Debian Squeeze)


Hi everyone,
Here's my public key (pub.pem):
Code:
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArnXhdXgd38iiwFqjSRT4
oi5g4XboKsxORJr21ip17AILoiEyNmXojY6DonvohIMn1Nr4iw6ScMt/7gVk3Z3Y
CLcPuJV6SMb6TRxE6NnCg9q/6Nxq21X7aUDwdP6L98PaCpU7879pHXCS5t3E+xw7
hDIzikL1nfQrY4kgsZLM75HsYzewBu8Hl2CTibUlLItz5h+yTC/tiG7cQRJdVKCw
bp3DwYgfvbhd9WYaPM3ESg8ho/MstAKtgdiRDWESPP+yWDGWU5ymhoETwKNEOsme
AujhInHW7qgzhfALvBRw3hc0lDFKeByJ/0Re4mm4et/tsnxp/5Px6qwbNacZORMj
WwIDAQAB
-----END PUBLIC KEY-----
And here's the command I'm using to try to encrypt a message (contained in file "archivo") and save the result to file "encriptado":
Code:
openssl rsautl -encrypt -inkey pub.pem -pubin -in archivo -out encriptado
But I keep getting the error: "Unable to load Public Key".
Any ideas on why this is happening?
 
Old 11-29-2012, 12:17 PM   #2
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 179

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by gacanepa View Post
Hi everyone,
Here's my public key (pub.pem):
Code:
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArnXhdXgd38iiwFqjSRT4
oi5g4XboKsxORJr21ip17AILoiEyNmXojY6DonvohIMn1Nr4iw6ScMt/7gVk3Z3Y
CLcPuJV6SMb6TRxE6NnCg9q/6Nxq21X7aUDwdP6L98PaCpU7879pHXCS5t3E+xw7
hDIzikL1nfQrY4kgsZLM75HsYzewBu8Hl2CTibUlLItz5h+yTC/tiG7cQRJdVKCw
bp3DwYgfvbhd9WYaPM3ESg8ho/MstAKtgdiRDWESPP+yWDGWU5ymhoETwKNEOsme
AujhInHW7qgzhfALvBRw3hc0lDFKeByJ/0Re4mm4et/tsnxp/5Px6qwbNacZORMj
WwIDAQAB
-----END PUBLIC KEY-----
And here's the command I'm using to try to encrypt a message (contained in file "archivo") and save the result to file "encriptado":
Code:
openssl rsautl -encrypt -inkey pub.pem -pubin -in archivo -out encriptado
But I keep getting the error: "Unable to load Public Key".
Any ideas on why this is happening?
I was able to find the solution to this issue. I uploaded the public key from the computer where I generated it in the first place to another one, and it worked. It seems that simply copying and pasting the public key's contents in a file named pub.pem (located in the remote computer) isn't the way to go.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving a public RSA key through the command line caseydk Linux - Newbie 4 06-30-2011 02:13 AM
Putty/SSH login failed when using RSA public key: 'Server refused our key' itsecx@gmail.com Linux - Server 10 10-04-2010 01:19 PM
Which is better RSA or DSA public key? tarballedtux Linux - Security 12 02-03-2009 06:15 AM
RSA public key encryption/private key decription koningshoed Linux - Security 1 08-08-2002 07:25 AM


All times are GMT -5. The time now is 02:52 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration