Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > OpenSSL and Key Passphrases

Reply
Thread Tools

OpenSSL and Key Passphrases

 
 
Jamis Buck
Guest
Posts: n/a
 
      07-28-2004
OpenSSL question:

I know you can create new keys easily using Ruby's OpenSSL module:

require 'openssl'

key = OpenSSL:Key:SA.new( 1024 )

However, is there a way to generate a new key that is protected by a
passphrase? I've picked through the ossl source code and don't see an
obvious answer to this question, so I figure it's either not possible,
or the procedure for doing it is non-obvious.

Thanks for any advice!

- Jamis

--
Jamis Buck
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.jamisbuck.org/jamis

"I use octal until I get to 8, and then I switch to decimal."


 
Reply With Quote
 
 
 
 
Jamis Buck
Guest
Posts: n/a
 
      07-28-2004
Jamis Buck wrote:
> OpenSSL question:
>
> I know you can create new keys easily using Ruby's OpenSSL module:
>
> require 'openssl'
>
> key = OpenSSL:Key:SA.new( 1024 )
>
> However, is there a way to generate a new key that is protected by a
> passphrase? I've picked through the ossl source code and don't see an
> obvious answer to this question, so I figure it's either not possible,
> or the procedure for doing it is non-obvious.
>
> Thanks for any advice!
>
> - Jamis
>


Duh. It always happens that way. I get desperate, ask the question, and
then discover the answer:

require 'openssl'

key = OpenSSL:Key:SA.new( 1024 )
puts key.export( OpenSSL::Cipher:ES.new, "howdy howdy" )

*sigh* Sorry for the noise.

--
Jamis Buck
(E-Mail Removed)
http://www.jamisbuck.org/jamis

"I use octal until I get to 8, and then I switch to decimal."


 
Reply With Quote
 
 
 
 
Eric Hodel
Guest
Posts: n/a
 
      07-29-2004
--Rn7IEEq3VEzCw+ji
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Jamis Buck ((E-Mail Removed)) wrote:

> Jamis Buck wrote:
> >OpenSSL question:
> >
> >I know you can create new keys easily using Ruby's OpenSSL module:
> >
> > require 'openssl'
> >
> > key =3D OpenSSL:Key:SA.new( 1024 )
> >
> >However, is there a way to generate a new key that is protected by a=20
> >passphrase? I've picked through the ossl source code and don't see an=20
> >obvious answer to this question, so I figure it's either not possible,=

=20
> >or the procedure for doing it is non-obvious.
> >
> >Thanks for any advice!
> >
> >- Jamis
> >

>=20
> Duh. It always happens that way. I get desperate, ask the question, and=

=20
> then discover the answer:
>=20
> require 'openssl'
>=20
> key =3D OpenSSL:Key:SA.new( 1024 )
> puts key.export( OpenSSL::Cipher:ES.new, "howdy howdy" )
>=20
> *sigh* Sorry for the noise.


I've written an SSL certificate generator tool called QuickCert that
handles a surprising amount of SSL-foo. (More than even I know it does,
probably, since its a compilation of support scripts I found lying
about.) I wrote it to help with DRb over SSL, but it is equally
suitable for use anywhere an SSL certificate or key is needed. You can
download it from:

http://segment7.net/projects/ruby/QuickCert/

--=20
Eric Hodel - (E-Mail Removed) - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04


--Rn7IEEq3VEzCw+ji
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iD8DBQFBCILhMypVHHlsnwQRAkgPAKCRQXnqNpDQHxefnLoFsc et89I3hgCglXYP
E2p6Cld4ODta5hH7yCqAUbk=
=9Fea
-----END PGP SIGNATURE-----

--Rn7IEEq3VEzCw+ji--


 
Reply With Quote
 
 
 
Reply

Thread Tools

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Confused about wireless passphrases vs. keys mike Wireless Networking 0 04-23-2011 02:16 PM
Are passphrases allowed in TrueCrypt? marck@eopq9.net Computer Security 7 01-10-2010 01:20 PM
Ruby and OpenSSL: no such file to load -- openssl (RuntimeError) Redd Vinylene Ruby 6 11-18-2008 08:51 AM
want to create and install private key certificate using openssl Notgiven Computer Security 2 08-02-2006 09:49 PM
Using Passphrases =?Utf-8?B?QUxTQVdBSQ==?= MCSE 3 07-04-2005 04:00 PM



Advertisments