Ask a Question related to ASP.NET Security, Design and Development.
-
Fred Herring #1
CryptoStream
I have some basic understanding questions about encryption. I am looking at
implementing the Rijndael (256) encryption scheme. Does this imply that the
key must be a string of 256 characters? Is the key something that I can just
type out or is this something the crypto class needs to generate for me. My
second questions is about the IV byte array. What function is served by this
byte array and what is the recommended manner to create this byte array?
Thanks,
Fred Herring
Fred Herring Guest
-
cryptostream,padding
My application produces BLOB's which need to be compressed and encrypted prior to transfer over the internet. I have inplemented a class called... -
Alek Davis #2
Re: CryptoStream
Fred,
Check these samples (I think they will answer your questions):
[url]http://www.obviex.com/Samples/Encryption.aspx[/url] (explains how to use Rijndael)
[url]http://www.obviex.com/Articles/CiphertextSize.aspx[/url] (there is a section
explaining what IV does and how it works)
Alek
"Fred Herring" <FredHerring@discussions.microsoft.com> wrote in message
news:07401221-19F8-4ABE-9A3E-12FE814CCC95@microsoft.com...at> I have some basic understanding questions about encryption. I am lookingthe> implementing the Rijndael (256) encryption scheme. Does this imply thatjust> key must be a string of 256 characters? Is the key something that I canMy> type out or is this something the crypto class needs to generate for me.this> second questions is about the IV byte array. What function is served by> byte array and what is the recommended manner to create this byte array?
>
> Thanks,
> Fred Herring
>
>
Alek Davis Guest
-
Alek Davis #3
Re: CryptoStream
Quick answers:
Rijndael key is typically a 256-bit (not character) value. It can also be
128 or 192-bit long, but 256 bits is your best bet (256 bits = 32 bytes).
You can define the actual bits (bytes) of the Rijndael key yourself, but a
more common approach is to derive the key from a password (passphrase),
which can be a string of any length (this is done using the API call
sequence you can follow in the example mentioned in the previous post). By
the way, you may need to figure out how to protect the key (or passphrase).
You need to use the initialization vector (IV) in certain (better)
encryption modes, such as CBC, for encrypting the first block of the
plaintext data (and decrypting the first block of the ciphertext). In other
modes, IV may not be needed, but these modes are typically not recommended,
so the rule of thumb is: use IV. The size of IV must match the encryption
block size, which in many cases is 16-byte (not bit) long, so you can use
any 16-character ASCII string for this.
Alek
"Alek Davis" <alek_xDOTx_davis_xATx_intel_xDOTx_com> wrote in message
news:OzRPo8D9EHA.2540@TK2MSFTNGP09.phx.gbl...Rijndael)> Fred,
>
> Check these samples (I think they will answer your questions):
>
> [url]http://www.obviex.com/Samples/Encryption.aspx[/url] (explains how to uselooking> [url]http://www.obviex.com/Articles/CiphertextSize.aspx[/url] (there is a section
> explaining what IV does and how it works)
>
> Alek
>
> "Fred Herring" <FredHerring@discussions.microsoft.com> wrote in message
> news:07401221-19F8-4ABE-9A3E-12FE814CCC95@microsoft.com...> > I have some basic understanding questions about encryption. I am> at> the> > implementing the Rijndael (256) encryption scheme. Does this imply that> just> > key must be a string of 256 characters? Is the key something that I can> My> > type out or is this something the crypto class needs to generate for me.> this> > second questions is about the IV byte array. What function is served by>> > byte array and what is the recommended manner to create this byte array?
> >
> > Thanks,
> > Fred Herring
> >
> >
>
Alek Davis Guest
-
Fred Herring #4
Re: CryptoStream
Thankyou very much. This is much clearer to me now. So 32 byte keys and
vectors can be represented by strings 32 characters and or numbers <=255.
dim MyIV() as byte={z,27,199,c,p,14... for 32 items}
Fred
"Alek Davis" wrote:
> Quick answers:
>
> Rijndael key is typically a 256-bit (not character) value. It can also be
> 128 or 192-bit long, but 256 bits is your best bet (256 bits = 32 bytes).
> You can define the actual bits (bytes) of the Rijndael key yourself, but a
> more common approach is to derive the key from a password (passphrase),
> which can be a string of any length (this is done using the API call
> sequence you can follow in the example mentioned in the previous post). By
> the way, you may need to figure out how to protect the key (or passphrase).
>
> You need to use the initialization vector (IV) in certain (better)
> encryption modes, such as CBC, for encrypting the first block of the
> plaintext data (and decrypting the first block of the ciphertext). In other
> modes, IV may not be needed, but these modes are typically not recommended,
> so the rule of thumb is: use IV. The size of IV must match the encryption
> block size, which in many cases is 16-byte (not bit) long, so you can use
> any 16-character ASCII string for this.
>
> Alek
>
> "Alek Davis" <alek_xDOTx_davis_xATx_intel_xDOTx_com> wrote in message
> news:OzRPo8D9EHA.2540@TK2MSFTNGP09.phx.gbl...> Rijndael)> > Fred,
> >
> > Check these samples (I think they will answer your questions):
> >
> > [url]http://www.obviex.com/Samples/Encryption.aspx[/url] (explains how to use> looking> > [url]http://www.obviex.com/Articles/CiphertextSize.aspx[/url] (there is a section
> > explaining what IV does and how it works)
> >
> > Alek
> >
> > "Fred Herring" <FredHerring@discussions.microsoft.com> wrote in message
> > news:07401221-19F8-4ABE-9A3E-12FE814CCC95@microsoft.com...> > > I have some basic understanding questions about encryption. I am>> > at> > the> > > implementing the Rijndael (256) encryption scheme. Does this imply that> > just> > > key must be a string of 256 characters? Is the key something that I can> > My> > > type out or is this something the crypto class needs to generate for me.> > this> > > second questions is about the IV byte array. What function is served by> >> > > byte array and what is the recommended manner to create this byte array?
> > >
> > > Thanks,
> > > Fred Herring
> > >
> > >
> >
>
>Fred Herring Guest
-
Alek Davis #5
Re: CryptoStream
Yes, they can be defined in bytes (bytes are chars or numbers <= 255). I'm
not sure if IV can be 32-byte long (I know it can be 16-byte long), so try
it out.
Alek
"Fred Herring" <FredHerring@discussions.microsoft.com> wrote in message
news:D67DF366-E21C-478F-A075-9F515F71D935@microsoft.com...be> Thankyou very much. This is much clearer to me now. So 32 byte keys and
> vectors can be represented by strings 32 characters and or numbers <=255.
>
> dim MyIV() as byte={z,27,199,c,p,14... for 32 items}
>
> Fred
>
> "Alek Davis" wrote:
>> > Quick answers:
> >
> > Rijndael key is typically a 256-bit (not character) value. It can alsobytes).> > 128 or 192-bit long, but 256 bits is your best bet (256 bits = 32a> > You can define the actual bits (bytes) of the Rijndael key yourself, butBy> > more common approach is to derive the key from a password (passphrase),
> > which can be a string of any length (this is done using the API call
> > sequence you can follow in the example mentioned in the previous post).passphrase).> > the way, you may need to figure out how to protect the key (orother> >
> > You need to use the initialization vector (IV) in certain (better)
> > encryption modes, such as CBC, for encrypting the first block of the
> > plaintext data (and decrypting the first block of the ciphertext). Inrecommended,> > modes, IV may not be needed, but these modes are typically notencryption> > so the rule of thumb is: use IV. The size of IV must match theuse> > block size, which in many cases is 16-byte (not bit) long, so you canmessage> > any 16-character ASCII string for this.
> >
> > Alek
> >
> > "Alek Davis" <alek_xDOTx_davis_xATx_intel_xDOTx_com> wrote in message
> > news:OzRPo8D9EHA.2540@TK2MSFTNGP09.phx.gbl...> > Rijndael)> > > Fred,
> > >
> > > Check these samples (I think they will answer your questions):
> > >
> > > [url]http://www.obviex.com/Samples/Encryption.aspx[/url] (explains how to use> > > [url]http://www.obviex.com/Articles/CiphertextSize.aspx[/url] (there is a section
> > > explaining what IV does and how it works)
> > >
> > > Alek
> > >
> > > "Fred Herring" <FredHerring@discussions.microsoft.com> wrote inthat> > looking> > > news:07401221-19F8-4ABE-9A3E-12FE814CCC95@microsoft.com...
> > > > I have some basic understanding questions about encryption. I am> > > at
> > > > implementing the Rijndael (256) encryption scheme. Does this implycan> > > the
> > > > key must be a string of 256 characters? Is the key something that Ime.> > > just
> > > > type out or is this something the crypto class needs to generate forserved by> > > My
> > > > second questions is about the IV byte array. What function isarray?> > > this
> > > > byte array and what is the recommended manner to create this byte> >> > > >
> > > > Thanks,
> > > > Fred Herring
> > > >
> > > >
> > >
> > >
> >
> >
Alek Davis Guest



Reply With Quote

