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. Algorithms
  4. Process time of the Skipjack and RC5 [modified]

Process time of the Skipjack and RC5 [modified]

Scheduled Pinned Locked Moved Algorithms
javasecurityquestioncareerlearning
6 Posts 2 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.
  • C Offline
    C Offline
    Cryptogrpahy
    wrote on last edited by
    #1

    java implemenation of the RC5 is too faster. Someone measured RC5 java.imp before? Here, process time of the RC5 encryption and decryption are almost expressed as 5 or 4 digits of the number in nanosecond. So someone tried it before? or saw any book, references on this job? I need the references for the RC5 java imp. Look it process time here: DES: enc - 804172 n.s dec - 442647 n.s RC5: enc - 13904 n.s dec - 3783 n.s

    modified on Monday, April 7, 2008 5:31 AM

    C 1 Reply Last reply
    0
    • C Cryptogrpahy

      java implemenation of the RC5 is too faster. Someone measured RC5 java.imp before? Here, process time of the RC5 encryption and decryption are almost expressed as 5 or 4 digits of the number in nanosecond. So someone tried it before? or saw any book, references on this job? I need the references for the RC5 java imp. Look it process time here: DES: enc - 804172 n.s dec - 442647 n.s RC5: enc - 13904 n.s dec - 3783 n.s

      modified on Monday, April 7, 2008 5:31 AM

      C Offline
      C Offline
      cp9876
      wrote on last edited by
      #2

      I'm not sure what you are asking, but if you look at the details of RC5 and DES it is not surprising that RC5 is way faster. The problem with DES is that it has a strange wordlength and has many bit operations. It was designed to be easy to implement in hardware because at that time software implementations of anything at the speeds required were not feasible. RC5 looks as if the operations align much better with the instruction set of a modern computer.

      Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

      C 1 Reply Last reply
      0
      • C cp9876

        I'm not sure what you are asking, but if you look at the details of RC5 and DES it is not surprising that RC5 is way faster. The problem with DES is that it has a strange wordlength and has many bit operations. It was designed to be easy to implement in hardware because at that time software implementations of anything at the speeds required were not feasible. RC5 looks as if the operations align much better with the instruction set of a modern computer.

        Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

        C Offline
        C Offline
        Cryptogrpahy
        wrote on last edited by
        #3

        Acctually, I'm doing comparison between 5 algorithms in the java imp. The comparison value at the RC5 is too shorter than others (DES, 3DES, Skipjack and Mine "new" ). If you know about RC5 and DES code below , please take a look on the source codes of them. Comeplete resource. RC5test.java ----------------------------RC5test.java--------------------------------- // RC5 demo worker thread. import java.math.BigInteger; import java.security.SecureRandom; import java.util.*; class RC5test { public static void main(String[] args) { RC5test aaa = new RC5test(); aaa.runa(); } public void runa() { SecureRandom random = new SecureRandom(); // cyphertext and iv data from the RSA test pseudo-contest "RSA-32/12/8-test" BigInteger pt1 = new BigInteger(32, random); long txt; RC5 rc5 = new RC5_32_12_8(); byte[] key = new byte[rc5.keySize()]; // uncommenting these lines gives the correct key, we'll just start searching close to it key[0] = (byte)0x82; key[1] = (byte)0xe5; key[2] = (byte)0x1b; key[3] = (byte)0x9f; key[4] = (byte)0x9c; key[5] = (byte)0xc7; key[6] = (byte)0x18; key[7] = (byte)0xf9; long stime, fdetime, detime, entime, fentime; stime = fdetime = detime = entime = fentime = 0; Random r = new Random(); long pt = (long)r.nextInt(); long cipher = 0; int i =0; for(i = 0; i<1000; i++){ stime = System.nanoTime(); rc5.setup(key); cipher = rc5.encrypt(pt); entime = System.nanoTime() - stime; System.out.println("Encryption Cipher: " +String.valueOf(cipher)); stime = System.nanoTime(); txt = rc5.decrypt(cipher);// ^ iv; detime = System.nanoTime() - stime; System.out.println("Decryption Cipher: " +String.valueOf(txt)); System.out.println(""); fdetime += detime; //System.out.println("Decryption: " +String.valueOf(detime)); fentime += entime; //System.out.println("Encryption: " +String.valueOf(entime)); } System.out.println("encrypt time: " + fentime/1000 + "ns"); System.out.println("decrypt time: " + fdetime/1000 + "ns"); System.out.println("run for: " + i + " times"); //Host.updateStats(keys, end - start, true); } } ----------------------------------------end of the RC5test--------------------------------------- RC5_32_12_8.java ---------------------------------------RC5_32_12_8.java------------------------------------------ // RC5-32/12/8 imple

        C 1 Reply Last reply
        0
        • C Cryptogrpahy

          Acctually, I'm doing comparison between 5 algorithms in the java imp. The comparison value at the RC5 is too shorter than others (DES, 3DES, Skipjack and Mine "new" ). If you know about RC5 and DES code below , please take a look on the source codes of them. Comeplete resource. RC5test.java ----------------------------RC5test.java--------------------------------- // RC5 demo worker thread. import java.math.BigInteger; import java.security.SecureRandom; import java.util.*; class RC5test { public static void main(String[] args) { RC5test aaa = new RC5test(); aaa.runa(); } public void runa() { SecureRandom random = new SecureRandom(); // cyphertext and iv data from the RSA test pseudo-contest "RSA-32/12/8-test" BigInteger pt1 = new BigInteger(32, random); long txt; RC5 rc5 = new RC5_32_12_8(); byte[] key = new byte[rc5.keySize()]; // uncommenting these lines gives the correct key, we'll just start searching close to it key[0] = (byte)0x82; key[1] = (byte)0xe5; key[2] = (byte)0x1b; key[3] = (byte)0x9f; key[4] = (byte)0x9c; key[5] = (byte)0xc7; key[6] = (byte)0x18; key[7] = (byte)0xf9; long stime, fdetime, detime, entime, fentime; stime = fdetime = detime = entime = fentime = 0; Random r = new Random(); long pt = (long)r.nextInt(); long cipher = 0; int i =0; for(i = 0; i<1000; i++){ stime = System.nanoTime(); rc5.setup(key); cipher = rc5.encrypt(pt); entime = System.nanoTime() - stime; System.out.println("Encryption Cipher: " +String.valueOf(cipher)); stime = System.nanoTime(); txt = rc5.decrypt(cipher);// ^ iv; detime = System.nanoTime() - stime; System.out.println("Decryption Cipher: " +String.valueOf(txt)); System.out.println(""); fdetime += detime; //System.out.println("Decryption: " +String.valueOf(detime)); fentime += entime; //System.out.println("Encryption: " +String.valueOf(entime)); } System.out.println("encrypt time: " + fentime/1000 + "ns"); System.out.println("decrypt time: " + fdetime/1000 + "ns"); System.out.println("run for: " + i + " times"); //Host.updateStats(keys, end - start, true); } } ----------------------------------------end of the RC5test--------------------------------------- RC5_32_12_8.java ---------------------------------------RC5_32_12_8.java------------------------------------------ // RC5-32/12/8 imple

          C Offline
          C Offline
          cp9876
          wrote on last edited by
          #4

          Look I'm not sure what you are trying to do, and I'm not interested in working through the swathe of code you pasted. If you step back a bit, you appear to be asking for information on RC5 implementation because

          Bimbaa wrote:

          The comparison value at the RC5 is too shorter than others (DES, 3DES, Skipjack and Mine "new" ).

          Look at the algorithms and try to understand which would take more instruction cycles. I think it will be clear why DES (and 3DES) is very slow in software compared to something like RC5. Also time is not everything, there are other issues like cryptographic security that should be addressed in comparing ciphers.

          Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

          C 1 Reply Last reply
          0
          • C cp9876

            Look I'm not sure what you are trying to do, and I'm not interested in working through the swathe of code you pasted. If you step back a bit, you appear to be asking for information on RC5 implementation because

            Bimbaa wrote:

            The comparison value at the RC5 is too shorter than others (DES, 3DES, Skipjack and Mine "new" ).

            Look at the algorithms and try to understand which would take more instruction cycles. I think it will be clear why DES (and 3DES) is very slow in software compared to something like RC5. Also time is not everything, there are other issues like cryptographic security that should be addressed in comparing ciphers.

            Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

            C Offline
            C Offline
            Cryptogrpahy
            wrote on last edited by
            #5

            Well. It seems like you've never been tried process time for any impl in java before. You may have theory and a bit pro.skill. If you tried and had idea, you would be said another instruction.X| Process may show different time at practice from the time at theory and time at talking. Yes, it can't be lost the cryptographic security issue that is explained by algorithm strength metric.

            C 1 Reply Last reply
            0
            • C Cryptogrpahy

              Well. It seems like you've never been tried process time for any impl in java before. You may have theory and a bit pro.skill. If you tried and had idea, you would be said another instruction.X| Process may show different time at practice from the time at theory and time at talking. Yes, it can't be lost the cryptographic security issue that is explained by algorithm strength metric.

              C Offline
              C Offline
              cp9876
              wrote on last edited by
              #6

              Bimbaa wrote:

              It seems like you've never been tried process time for any impl in java before

              I've never done much in Java at all :-D :-D I'm not sure what you are saying, but some things are easy to do in software and some aren't. The difference in performance between software implementations of RC5 and DES in ANY language are due primarily to the fact that RC5 works on whole computer words and does simple operations like XOR and rotations. DES (and 3DES) on the other hand has some nasty bit permutations (see here [^] :omg: ) which are horrible and time consuming on any processor regardless of language. Anyway, good luck with whatever you are trying to do :confused:.

              Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

              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