Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Help

Help

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 13023118
    wrote on last edited by
    #1

    I'am a bigenner in cyptology. It's really an interested domain. I have started in cryptography by modifyiong the round function of xtea and by modifying the p-layer of PRESENT. I find it sample but when I will do differential and linear cryptanalysis on them it becomes more difficult because I didn't find a sample example to understand more the principle. Can anyone help me with code c of differential cryptanalysis of PRESENT and XTEA. I will be grateful for you

    L 1 Reply Last reply
    0
    • M Member 13023118

      I'am a bigenner in cyptology. It's really an interested domain. I have started in cryptography by modifyiong the round function of xtea and by modifying the p-layer of PRESENT. I find it sample but when I will do differential and linear cryptanalysis on them it becomes more difficult because I didn't find a sample example to understand more the principle. Can anyone help me with code c of differential cryptanalysis of PRESENT and XTEA. I will be grateful for you

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Member 13023118 wrote:

      code c of differential cryptanalysis of PRESENT and XTEA

      That is a good question for Google, or Search[^] the CodeProject articles.

      M 1 Reply Last reply
      0
      • L Lost User

        Member 13023118 wrote:

        code c of differential cryptanalysis of PRESENT and XTEA

        That is a good question for Google, or Search[^] the CodeProject articles.

        M Offline
        M Offline
        Member 13023118
        wrote on last edited by
        #3

        I have searched in different sites but I didn't find any code that can help me

        L L 2 Replies Last reply
        0
        • M Member 13023118

          I have searched in different sites but I didn't find any code that can help me

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Then maybe no one has yet written any.

          1 Reply Last reply
          0
          • M Member 13023118

            I have searched in different sites but I didn't find any code that can help me

            L Offline
            L Offline
            leon de boer
            wrote on last edited by
            #5

            You didn't look very hard the C code is right there in wikipedia (XTEA - Wikipedia[^])

            #include

            /* take 64 bits of data in v[0] and v[1] and 128 bits of key[0] - key[3] */

            void encipher(unsigned int num_rounds, uint32_t v[2], uint32_t const key[4]) {
            unsigned int i;
            uint32_t v0=v[0], v1=v[1], sum=0, delta=0x9E3779B9;
            for (i=0; i < num_rounds; i++) {
            v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key[sum & 3]);
            sum += delta;
            v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key[(sum>>11) & 3]);
            }
            v[0]=v0; v[1]=v1;
            }

            void decipher(unsigned int num_rounds, uint32_t v[2], uint32_t const key[4]) {
            unsigned int i;
            uint32_t v0=v[0], v1=v[1], delta=0x9E3779B9, sum=delta*num_rounds;
            for (i=0; i < num_rounds; i++) {
            v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key[(sum>>11) & 3]);
            sum -= delta;
            v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key[sum & 3]);
            }
            v[0]=v0; v[1]=v1;
            }

            The C implementation for PRESENT you can get here in 8, 16 or 32 bit ... PRESENT Encryption

            In vino veritas

            M 1 Reply Last reply
            0
            • L leon de boer

              You didn't look very hard the C code is right there in wikipedia (XTEA - Wikipedia[^])

              #include

              /* take 64 bits of data in v[0] and v[1] and 128 bits of key[0] - key[3] */

              void encipher(unsigned int num_rounds, uint32_t v[2], uint32_t const key[4]) {
              unsigned int i;
              uint32_t v0=v[0], v1=v[1], sum=0, delta=0x9E3779B9;
              for (i=0; i < num_rounds; i++) {
              v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key[sum & 3]);
              sum += delta;
              v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key[(sum>>11) & 3]);
              }
              v[0]=v0; v[1]=v1;
              }

              void decipher(unsigned int num_rounds, uint32_t v[2], uint32_t const key[4]) {
              unsigned int i;
              uint32_t v0=v[0], v1=v[1], delta=0x9E3779B9, sum=delta*num_rounds;
              for (i=0; i < num_rounds; i++) {
              v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key[(sum>>11) & 3]);
              sum -= delta;
              v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key[sum & 3]);
              }
              v[0]=v0; v[1]=v1;
              }

              The C implementation for PRESENT you can get here in 8, 16 or 32 bit ... PRESENT Encryption

              In vino veritas

              M Offline
              M Offline
              Member 13023118
              wrote on last edited by
              #6

              Thanks alot for your help but I have already got it and I also modify xtea round function to become more secure but my problem now is to understand the principle of differential cryptanalysis that's why I need code c of of differential cryptanalysis in both of algorithms xtea and PRESENT

              L 1 Reply Last reply
              0
              • M Member 13023118

                Thanks alot for your help but I have already got it and I also modify xtea round function to become more secure but my problem now is to understand the principle of differential cryptanalysis that's why I need code c of of differential cryptanalysis in both of algorithms xtea and PRESENT

                L Offline
                L Offline
                leon de boer
                wrote on last edited by
                #7

                Okay I am just a boring old programmer you got me intrigued how do you produce code for the differential it would be incredibly long given the statistical spread of the output. I know for example AES is immune to any sort of differential attack if you look at the algorithm you can see why. I can tell you from practical doing it, that it's easier to just brute force attack these things. That is why I suggest the code doesn't exist :-) If you want to find out how secure your modification is time the bruteforce attack on it.

                In vino veritas

                M 1 Reply Last reply
                0
                • L leon de boer

                  Okay I am just a boring old programmer you got me intrigued how do you produce code for the differential it would be incredibly long given the statistical spread of the output. I know for example AES is immune to any sort of differential attack if you look at the algorithm you can see why. I can tell you from practical doing it, that it's easier to just brute force attack these things. That is why I suggest the code doesn't exist :-) If you want to find out how secure your modification is time the bruteforce attack on it.

                  In vino veritas

                  M Offline
                  M Offline
                  Member 13023118
                  wrote on last edited by
                  #8

                  That is why I suggest the code doesn't exist

                  L 1 Reply Last reply
                  0
                  • M Member 13023118

                    That is why I suggest the code doesn't exist

                    L Offline
                    L Offline
                    leon de boer
                    wrote on last edited by
                    #9

                    Have you tried brute forcing that cipher it's interesting, I just tried a small block :-)

                    In vino veritas

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups