Newbie question on encryption keys

Newbie question on encryption keys

Secure Home | Search | About
 General Computer Security    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content add this group's latest topics to your Google content
Subject Author Date
Newbie question on encryption keys rohanm79 07-10-2007
Posted by on July 10, 2007, 3:05 am
If you were  Registered and logged in, you could reply and use other advanced thread options
I am a little confused about creating encryption keys. How exactly
does one create a 128, 512 or 1024 bit key? If I use an encryption
software, does the encryption key mean the password? If so, is it
enough if I create a 128/8=16 char password or even 512/8=64 char
password?


Posted by Mark Shroyer on July 10, 2007, 3:22 am
If you were  Registered and logged in, you could reply and use other advanced thread options
> I am a little confused about creating encryption keys. How exactly
> does one create a 128, 512 or 1024 bit key? If I use an encryption
> software, does the encryption key mean the password? If so, is it
> enough if I create a 128/8=16 char password or even 512/8=64 char
> password?

How to specify key length depends on what kind of software you're
talking about. Usually it's set as some sort of command-line
argument or in a config file, or it may be prompted for
interactively. Consult the man page for details.

Dealing with public key encryption systems, the actual encryption
key generally has nothing to do with the password which you may or
may not be asked to provide. When you create a keypair with, e.g.,
GPG or OpenSSL, the key parameters themselves are pseudorandomly (or
randomly, depending on your hardware) generated in the program. The
password is only used as the basis for a /symmetric/ key with which
to protect the generated private encryption key; this is done to
make it more difficult for an attacker to obtain your private key,
should the file it is contained within fall into the wrong hands.

Let us know which particular software you're dealing with if that
didn't completely answer your question.

Mark

--
Mark Shroyer
http://markshroyer.com/

Posted by on July 10, 2007, 3:30 am
If you were  Registered and logged in, you could reply and use other advanced thread options
>
> > I am a little confused about creating encryption keys. How exactly
> > does one create a 128, 512 or 1024 bit key? If I use an encryption
> > software, does the encryption key mean the password? If so, is it
> > enough if I create a 128/8=16 char password or even 512/8=64 char
> > password?
>
> How to specify key length depends on what kind of software you're
> talking about. Usually it's set as some sort of command-line
> argument or in a config file, or it may be prompted for
> interactively. Consult the man page for details.
>
> Dealing with public key encryption systems, the actual encryption
> key generally has nothing to do with the password which you may or
> may not be asked to provide. When you create a keypair with, e.g.,
> GPG or OpenSSL, the key parameters themselves are pseudorandomly (or
> randomly, depending on your hardware) generated in the program. The
> password is only used as the basis for a /symmetric/ key with which
> to protect the generated private encryption key; this is done to
> make it more difficult for an attacker to obtain your private key,
> should the file it is contained within fall into the wrong hands.
>
> Let us know which particular software you're dealing with if that
> didn't completely answer your question.
>
> Mark
>
> --
> Mark Shroyerhttp://markshroyer.com/

Thanks Mark. Basically, I found some software that does AES and
Blowfish encryption on text and other files. I know that AES uses 256
bit keys for encryption and it asked me to give a password. I wasnt
sure if I needed to give a 32 char password because it did the
encryption even with smaller passwords. So how do I know what was the
key used for encryption? And how do I communicate that key to the
recipient of the encrypted file?


Posted by Mark Shroyer on July 10, 2007, 5:15 am
If you were  Registered and logged in, you could reply and use other advanced thread options
>>
>> > I am a little confused about creating encryption keys. How exactly
>> > does one create a 128, 512 or 1024 bit key? If I use an encryption
>> > software, does the encryption key mean the password? If so, is it
>> > enough if I create a 128/8=16 char password or even 512/8=64 char
>> > password?
>>
>> How to specify key length depends on what kind of software you're
>> talking about. Usually it's set as some sort of command-line
>> argument or in a config file, or it may be prompted for
>> interactively. Consult the man page for details.
>>
>> Dealing with public key encryption systems, the actual encryption
>> key generally has nothing to do with the password which you may or
>> may not be asked to provide. When you create a keypair with, e.g.,
>> GPG or OpenSSL, the key parameters themselves are pseudorandomly (or
>> randomly, depending on your hardware) generated in the program. The
>> password is only used as the basis for a /symmetric/ key with which
>> to protect the generated private encryption key; this is done to
>> make it more difficult for an attacker to obtain your private key,
>> should the file it is contained within fall into the wrong hands.
>>
>> Let us know which particular software you're dealing with if that
>> didn't completely answer your question.
>
> Thanks Mark. Basically, I found some software that does AES and
> Blowfish encryption on text and other files. I know that AES uses 256
> bit keys for encryption and it asked me to give a password. I wasnt
> sure if I needed to give a 32 char password because it did the
> encryption even with smaller passwords. So how do I know what was the
> key used for encryption? And how do I communicate that key to the
> recipient of the encrypted file?

No, you shouldn't need to enter a 32-character password (although I
can't say for sure because you still haven't specified what software
you're talking about :) ). What usually happens is that the 256-bit
symmetric key is generated as some hash of whatever password you
provide. The longer and more random the password (until you get
past 32 random ASCII characters, anyway), the more entropy in your
256-bit AES key and therefore the more theoretically secure it is --
but in practice a dozen or so characters should be all the entropy
you need, depending on the quality of your software's hash algorithm
and how sensitive your data is.

As for communicating the encrypted data to somebody else, you'll
both really want to be using the same encryption software. There's
no de-facto standard algorithm for converting passwords into
symmetric encryption keys (as far as I know -- maybe someone here
knows better?), so different software might interpret the same
password as signifying different keys. You probably won't be able
to determine the actual AES key that your software used unless
you're willing to dig into its source code.

On top of that, the output of your encryption software may not be
strictly an AES-encrypted copy of the original data: it could
contain some header information or be formatted in some particular
way, and will hopefully have been compressed prior to encryption for
added security; different encryption software is incompatible also
in these respects. So use the same software as your recipient, and
(physically, not electronically -- but you probably knew that
already) provide him or her your encryption key in the form of the
password.

Out of curiosity, why are you interested in obtaining the raw AES
key?

--
Mark Shroyer
http://markshroyer.com/

Posted by Ertugrul Soeylemez on July 10, 2007, 10:55 pm
If you were  Registered and logged in, you could reply and use other advanced thread options

> > Thanks Mark. Basically, I found some software that does AES and
> > Blowfish encryption on text and other files. I know that AES uses
> > 256 bit keys for encryption and it asked me to give a password. I
> > wasnt sure if I needed to give a 32 char password because it did the
> > encryption even with smaller passwords. So how do I know what was
> > the key used for encryption? And how do I communicate that key to
> > the recipient of the encrypted file?
>
> No, you shouldn't need to enter a 32-character password (although I
> can't say for sure because you still haven't specified what software
> you're talking about :) ). What usually happens is that the 256-bit
> symmetric key is generated as some hash of whatever password you
> provide. The longer and more random the password (until you get past
> 32 random ASCII characters, anyway), the more entropy in your 256-bit
> AES key and therefore the more theoretically secure it is -- but in
> practice a dozen or so characters should be all the entropy you need,
> depending on the quality of your software's hash algorithm and how
> sensitive your data is.

This is imprecise. 32 characters will by far not be enough for the
password to have 256 bits of entropy. Remember that users only use a
subset of all possible characters (and they shouldn't use them all,
because of localization issues).

In most cases one character of the password will have slightly less than
seven bits of entropy, because you don't type eight bit characters, and
you also don't type control characters.


> There's no de-facto standard algorithm for converting passwords into
> symmetric encryption keys (as far as I know -- maybe someone here
> knows better?), [...]

There is: PBKDF2, for example.


> [...] so different software might interpret the same password as
> signifying different keys. You probably won't be able to determine
> the actual AES key that your software used unless you're willing to
> dig into its source code.

If they both use the same protocol together with the same specification,
then most likely they will be compatible.


Regards,
Ertugrul S=C3=B6ylemez.


--=20
Security is the one concept, which makes things in your life stay as
they are. Otto is a man, who is afraid of changes in his life; so
naturally he does not employ security.

Similar ThreadsPosted
X.509 Digital Certificate Newbie Question April 12, 2005, 3:55 am
Question from a newbie -- protecting files July 20, 2005, 3:01 pm
A basic/newbie question on https. January 30, 2008, 8:55 pm
hiding encryption keys August 12, 2005, 3:32 pm
typical approach for encryption using keys? June 27, 2007, 6:20 am
RSA encryption - practical question March 14, 2006, 12:11 pm
Tunneling newbie? February 21, 2005, 8:52 pm
Newbie... need basics August 10, 2006, 8:01 pm
Spoofing fingerprint scanners - NEWBIE() May 1, 2006, 1:57 pm
Newbie: (unwanted) incoming traffice on static DSL line November 20, 2005, 8:17 pm

The site map in XML format XML site map

Contact Us | Privacy Policy