Ask a Question related to ASP.NET Security, Design and Development.
-
Dale #1
Cryptography
I am trying to decide on an cryptography class to use with my ASP.NET web
application. I have looked and several articles on building crypto classes,
but I wanted to stick with Microsoft best practices. The application could
contain some very sensitive information.
The first class I looked at was DPAPI
([url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT07.asp[/url]).
However, I cannot use this because the application is hosted on a clustered
server, which eliminates the ability to use the machine store. Additionally,
the server does not load a user profile for the ASP.NET account, so the user
store will also not work.
What I’m looking at now is the cryptography classes included in the
Microsoft Enterprise Library
([url]http://www.microsoft.com/downloads/details.aspx?DisplayLang=en&FamilyId=0325b97a-9534-4349-8038-d56b38ec394c[/url]).
It looks like the key is stored in a plain text configuration file
(securityCryptographyConfiguration.config). Would anyone who is able to
access the config file be able to decrypt my data?
Does anyone have any other suggestions?
Thanks for your help.
Dale Guest
-
.NET cryptography FIPS 140 compliance
I am trying to determine whether the default encryption algorithms used by the .NET framework cryptographic APIs are FIPS 140 compliant (ideally... -
Good book of Cryptography
Hi, any know some good book of cryptography using the .NET Framework? Thanks. Dexter -
Cryptography Issue
I'm having the issue with an asp web service not having access to the Cryptographic Service Container (CSP). Yes, I've read the knowledge base... -
System.Security.Cryptography.MD5CryptoServiceProvider
I'm wonder if anyone has tested the System.Security.Cryptography.MD5CryptoServiceProvider against the RFC 1321 Test suite? For example, here is... -
Cryptography in ASP
Hello Gregory. Thank you for you answer on my question. You are right. I red about CAPICOM in MSDN. I got and installed test VerySign... -
Alvin Bruney [MVP - ASP.NET] #2
Re: Cryptography
Yes, if it is available it can be decrypted. The best practice is to store
that information in the registry and protect access to the registry thru the
ACL. You may also encrypt the registry hive contents to make it harder for
users with access to the registry to find and use the information
--
Regards,
Alvin Bruney - ASP.NET MVP
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ [url]www.lulu.com/owc[/url]
"Dale" <dale@nospam.nospam> wrote in message
news:8186613B-3A0C-4827-84EA-4A459CE86F3F@microsoft.com...>I am trying to decide on an cryptography class to use with my ASP.NET web
> application. I have looked and several articles on building crypto
> classes,
> but I wanted to stick with Microsoft best practices. The application could
> contain some very sensitive information.
>
> The first class I looked at was DPAPI
> ([url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT07.asp[/url]).
> However, I cannot use this because the application is hosted on a
> clustered
> server, which eliminates the ability to use the machine store.
> Additionally,
> the server does not load a user profile for the ASP.NET account, so the
> user
> store will also not work.
>
> What I'm looking at now is the cryptography classes included in the
> Microsoft Enterprise Library
> ([url]http://www.microsoft.com/downloads/details.aspx?DisplayLang=en&FamilyId=0325b97a-9534-4349-8038-d56b38ec394c[/url]).
> It looks like the key is stored in a plain text configuration file
> (securityCryptographyConfiguration.config). Would anyone who is able to
> access the config file be able to decrypt my data?
>
> Does anyone have any other suggestions?
>
> Thanks for your help.
Alvin Bruney [MVP - ASP.NET] Guest
-
Andrew Robinson #3
Cryptography
I am using the Rijndael Crypto Providor in .NET to successfully encrypt and
decript some data that I am passing from page to page via a query string.
All seems to be working well.
The data that I am encrypting is a number of 4 byte integer fields. I
concatinate them into a byte array and then excrypt them.
Question:
When one of the trailing integers changes (and nothing else), the excrypted
string is almost the same as the previous string. This is not the case when
only one of the leading integer fields changes my a small amount.
Should I be putting some type of check field as the begining of my set of
fields before encrypting them? I will toss the check integer when
decrypting, but it seems to greatly change the value of the entire encrypted
string.
-Andrew
Andrew Robinson Guest
-
Kevin Yu [MSFT] #4
RE: Cryptography
Hi
We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Kevin Yu [MSFT] Guest
-
Steven Cheng[MSFT] #5
RE: Cryptography
Hi Andrew,
Welcome to .NET newsgroup.
As for the question on using Rijndael Crypto Providor to encrypt data,
here are some of my understandings:
1. Such encryption algorithm as Rijndael are called symmetric encryption,
whicn only need a single secret key to encrypt and decrypt data. And
symmetric encryption are block based that means actually it can only
encrypt a limited lengh of data each time. So when encrypting large byte
stream, it use a cipher block chaining mechanism, which use a given key and
an IV to encrypt the first block, then, all the sequential block (bytes in
the stream) are encrypted depend on the key and the encrypted bytes from
the pervious block. Here is the detailed description in MSDN:
===================
Typically, secret-key algorithms, called block ciphers, are used to encrypt
one block of data at a time. Block ciphers (like RC2, DES, TripleDES, and
Rijndael) cryptographically transform an input block of n bytes into an
output block of encrypted bytes. If you want to encrypt or decrypt a
sequence of bytes, you have to do it block by block. Because n is small (n
= 8 bytes for RC2, DES, and TripleDES; n = 16 [the default], n = 24, or n =
32 bytes for Rijndael), values larger than n have to be encrypted one block
at a time.
The block cipher classes provided in the base class library use a chaining
mode called cipher block chaining (CBC), which uses a key and an
initialization vector (IV) to perform cryptographic transformations on
data. For a given secret key k, a simple block cipher that does not use an
initialization vector will encrypt the same input block of plain text into
the same output block of cipher text. If you have duplicate blocks within
your plain text stream, you will have duplicate blocks within your cipher
text stream. If unauthorized users know anything about the structure of a
block of your plain text, they can use that information to decipher the
known cipher text block and possibly recover your key. To combat this
problem, information from the previous block is mixed into the process of
encrypting the next block. Thus, the output of two identical plain text
blocks is different. Because this technique uses the previous block to
encrypt the next block, an IV is used to encrypt the first block of data.
Using this system, common message headers that might be known to an
unauthorized user cannot be used to reverse engineer a key.
========================
You can also have a look at the following reference:
#Cryptography Overview
[url]http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcryptographyovervi[/url]
ew.asp?frame=true
Then, since the latter block data is encrypted depend on the former
encrypted result, when the former block changes, the sequential encrypted
bytes will apparently changes. However, if we only change the last block,
the change is not very obvious.
2. As for encryption/decryption itself , it can only make the data
unreadable from unauthorized users, but can't ensure the data won't be
modified by other ones. If you want to ensure the data not be modified(
check the integrity and consistency), you should considering apply digital
signasure together with encryption. Here is the reference on applying
digtal signature through the BCL classes in .net framework:
#Ensuring Data Integrity with Hash Codes
[url]http://msdn.microsoft.com/library/en-us/cpguide/html/cpconensuringdataintegr[/url]
itywithhashcodes.asp?frame=true
Typically, digital signing is done through Asymmetric encryption/decription
and data hashing. You can find detailed description in the above links.
Hope helps. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure! [url]www.microsoft.com/security[/url]
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Steven Cheng[MSFT] Guest



Reply With Quote

