Generate Key using Cipher Block Chaining MAC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • danishce
    New Member
    • Apr 2007
    • 31

    Generate Key using Cipher Block Chaining MAC

    I want to encrypt the ASCII message using Cipher Block Chaining MAC and generate the 8 byte key.How can i achieve this?
    Thanks:
    Danish Majid
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2

    Comment

    • RedSon
      Recognized Expert Expert
      • Jan 2007
      • 4980

      #3
      Originally posted by danishce
      I want to encrypt the ASCII message using Cipher Block Chaining MAC and generate the 8 byte key.How can i achieve this?
      Thanks:
      Danish Majid
      The document titled ISO/IEC 9797-2:2002 describes 3 algorithms you can use to create this. The document costs money but you can see if your local library or university library can get a copy for you.

      Comment

      • danishce
        New Member
        • Apr 2007
        • 31

        #4
        Thanks for the reply but i implement CBC MAC using vb.net and generate 8 byte key through applying CBC MAC on the whole message. Do you know any website link/article where i can find source code for CBC MAC using vb.net because i can not find any code for CBC MAC in google.
        Thanks:
        Danish Majid

        Comment

        • RedSon
          Recognized Expert Expert
          • Jan 2007
          • 4980

          #5
          Originally posted by danishce
          Thanks for the reply but i implement CBC MAC using vb.net and generate 8 byte key through applying CBC MAC on the whole message. Do you know any website link/article where i can find source code for CBC MAC using vb.net because i can not find any code for CBC MAC in google.
          Thanks:
          Danish Majid
          Microsoft already implements this method. http://msdn2.microsoft.com/en-us/library/aa382459.aspx
          You can use their CryptoAPI.

          Comment

          • danishce
            New Member
            • Apr 2007
            • 31

            #6
            The example described in this website used for encrypting data but i want to generate 8 byte key in output through applying CBC MAC to whole message.
            suppose sample message is 642 ASCII characters
            message=0005422 000002789454602 028020263020024 8898712120..... .
            the key generate by applying CBC MAC through this message is
            key=24598762

            this is my requirement to generate 8 byte key by applying CBC MAC to whole message.

            How can i implement this in vb.net ? because i can only find code for encrypting message.
            Thanks:
            Danish

            Comment

            • RedSon
              Recognized Expert Expert
              • Jan 2007
              • 4980

              #7
              Originally posted by danishce
              The example described in this website used for encrypting data but i want to generate 8 byte key in output through applying CBC MAC to whole message.
              suppose sample message is 642 ASCII characters
              message=0005422 000002789454602 028020263020024 8898712120..... .
              the key generate by applying CBC MAC through this message is
              key=24598762

              this is my requirement to generate 8 byte key by applying CBC MAC to whole message.

              How can i implement this in vb.net ? because i can only find code for encrypting message.
              Thanks:
              Danish
              I don't know how to do it in VB but if C++ you would be looking for these functions: http://msdn2.microsoft.com/en-us/library/aa379908.aspx

              Hopefully that will put you on the right path to finding the right libraries for VB

              Comment

              • RedSon
                Recognized Expert Expert
                • Jan 2007
                • 4980

                #8
                Originally posted by RedSon
                I don't know how to do it in VB but if C++ you would be looking for these functions: http://msdn2.microsoft.com/en-us/library/aa379908.aspx

                Hopefully that will put you on the right path to finding the right libraries for VB
                Actually I found something that will help you better:
                Microsoft technical documentation for older versions of products, services and technologies.

                Comment

                • danishce
                  New Member
                  • Apr 2007
                  • 31

                  #9
                  Still i can not find solution to my problem on generating 8 byte hex key by applying CBC MAC to whole message using vb.net.
                  Any one can help me out?

                  Comment

                  • Plater
                    Recognized Expert Expert
                    • Apr 2007
                    • 7872

                    #10
                    I am still not sure what you are after, so I'll breakdown some parts

                    *You receive a message of 642ascii characters.
                    Is this the real message or an already encrypted message?

                    *You want to generate an 8byte DECRYPTION key for that message.
                    Now if the message was already encrypted, I don't think you can determine it's decrypting key just by looking at it, that kinda defeats the purpose don't you think? If the message is plain and you want the key that could be used to decrypt it once it's encrypted, then encrypt it and view the key that was used. Actually I think you can make up whatever key you want and use it to encrypt it.


                    But I always did bad at cryptology in school.

                    Comment

                    • RedSon
                      Recognized Expert Expert
                      • Jan 2007
                      • 4980

                      #11
                      Originally posted by Plater
                      I am still not sure what you are after, so I'll breakdown some parts

                      *You receive a message of 642ascii characters.
                      Is this the real message or an already encrypted message?

                      *You want to generate an 8byte DECRYPTION key for that message.
                      Now if the message was already encrypted, I don't think you can determine it's decrypting key just by looking at it, that kinda defeats the purpose don't you think? If the message is plain and you want the key that could be used to decrypt it once it's encrypted, then encrypt it and view the key that was used. Actually I think you can make up whatever key you want and use it to encrypt it.


                      But I always did bad at cryptology in school.
                      I took it to mean that the OP wants to create a signature key. A two way hash of the message to compare its authenticity. In any case, the links provided do show how to encrypt a message, decrypt a message, and create a hash of a message.

                      Comment

                      • danishce
                        New Member
                        • Apr 2007
                        • 31

                        #12
                        The 642 ASCII Characters are in Simple Plain Text and i want to generate 8 Byte key on applying CBC MAC to whole message. I dont know how to achieve this in vb.net?

                        Comment

                        • RedSon
                          Recognized Expert Expert
                          • Jan 2007
                          • 4980

                          #13
                          Originally posted by danishce
                          The 642 ASCII Characters are in Simple Plain Text and i want to generate 8 Byte key on applying CBC MAC to whole message. I dont know how to achieve this in vb.net?
                          What do you mean "create key"? You want to make the ASCII characters your key to use to encrypt data? Or do you want to create some kind of message digest or crytographic signature against the 642 ASCII Characters?

                          If you want to do the latter the link I provided in my prevoius post links directly to an article on MSDN as to how to Generate Signatures. It provides the VB code right there for you to look at. If you want to encrypt or decrypt data given a 642 ASCII Character key then right above where that page is on MSDN lists other Cryptograpic Tasks on how to Encrypt and Decrypt Data.

                          When you say "generate an 8 byte key" that means you want to create an 8 byte message digest (hash) or an 8 byte digital signature.

                          Comment

                          • danishce
                            New Member
                            • Apr 2007
                            • 31

                            #14
                            Hi,

                            I need to calculate the Cryptographic checksum using ISO/IEC 9797-1 MAC
                            algorithm with cipher block chaining MAC. The resultant MAC length must be 8 bytes.
                            As a sample, the data I am working on now is:
                            Data = '72C29C2371CC9B DB65B779B8E8D37 B29ECC154AA56A8 799FA E2F498F76ED92F2 '
                            Kmac = '7962D9ECE03D1A CD4C76089DCE131 543'


                            Resultant MAC[Kmac](Data)='5326532 0' (I want to know how to get
                            to this value using vb.net).
                            I search this on google but no success for the last 1 week.
                            Any code on urgent basis?

                            Comment

                            • RedSon
                              Recognized Expert Expert
                              • Jan 2007
                              • 4980

                              #15
                              Originally posted by danishce
                              Hi,

                              I need to calculate the Cryptographic checksum using ISO/IEC 9797-1 MAC
                              algorithm with cipher block chaining MAC. The resultant MAC length must be 8 bytes.
                              As a sample, the data I am working on now is:
                              Data = '72C29C2371CC9B DB65B779B8E8D37 B29ECC154AA56A8 799FA E2F498F76ED92F2 '
                              Kmac = '7962D9ECE03D1A CD4C76089DCE131 543'


                              Resultant MAC[Kmac](Data)='5326532 0' (I want to know how to get
                              to this value using vb.net).
                              I search this on google but no success for the last 1 week.
                              Any code on urgent basis?
                              This is the MSDN article about how to generate a cryptographic hash also known as a checksum.



                              You will have to do some research to find out if Microsoft's implementation is equal to the ISO/IEC 9797-1 MAC algorithm. This will give you code samples on how to create something similar to what you need. Microsoft has implemented several cryptographic service providers for you to use. It is now up to you to read what is available on MSDN and try to use the crypto APIs to do what you need them to do or write your own custom crypto service provider.

                              Please be advised that it is never a good idea to create your own crypto service provider since there may be problems with the security of your algorithm. The CSPs provided by Microsoft have been throughly tested.

                              Comment

                              Working...