Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. .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...
    2. Good book of Cryptography
      Hi, any know some good book of cryptography using the .NET Framework? Thanks. Dexter
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

  6. #5

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139