1 / 9

Computer Science 320

Computer Science 320. Introduction to Hybrid SMP/ Clusters. Massively Parallel AES Key Search. Inputs: 128-bit plain text block 128-bit cipher text block 256-bit key with N lower-order bits missing N, the number of missing lower-order key bits Output: The correct key to encode the text

sue
Download Presentation

Computer Science 320

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Science 320 Introduction to Hybrid SMP/Clusters

  2. Massively Parallel AES Key Search • Inputs: • 128-bit plain text block • 128-bit cipher text block • 256-bit key with N lower-order bits missing • N, the number of missing lower-order key bits • Output: The correct key to encode the text • Method: try all 2N possible missing bit strings to find the key that does encrypt the plain text correctly

  3. Sequential Version for (intcntr = 0; cntr < maxcount; ++cntr){ // Try key } Tries up to 2N possible keys

  4. SMP Version new ParallelTeam().execute(new ParallelRegion(){ public void run() throws Exception{ execute(0, maxcounter, new IntegerForLoop(){ public void run(){ for (intcntr = first; cntr <= last; ++cntr){ // Try key } } }); } }); Splits 2N possible keys evenly among K threads

  5. Cluster Version Range chunk = new Range(0, maxcounter – 1).subrange(size, rank); int lb = chunk.lb(); int ub = chunk.ub(); for (int cntr = lb; cntr <= ub; ++cntr){ // Try key } Splits 2N possible keys evenly among K nodes

  6. Hybrid Version Range chunk = new Range(0, maxcounter – 1).subrange(size, rank); int lb = chunk.lb(); int ub = chunk.ub(); new ParallelTeam().execute(new ParallelRegion(){ public void run() throws Exception{ execute(lb, ub, new IntegerForLoop(){ public void run(){ for (int cntr = first; cntr <= last; ++cntr){ // Try key } } }); } }); Splits 2N possible keys evenly among Kp nodes * Kt threads per node

  7. Specify # Nodes and # Threads Range chunk = new Range(0, maxcounter – 1).subrange(size, rank); int lb = chunk.lb(); int ub = chunk.ub(); new ParallelTeam().execute(new ParallelRegion(){ public void run() throws Exception{ execute(lb, ub, new IntegerForLoop(){ public void run(){ for (int cntr = first; cntr <= last; ++cntr){ // Try key } } }); } }); $ java –Dpj.port=28000 –Dpj.np=8 -Dpj.nt=8 . . .

  8. Improvement: Early Return for (intcntr = first; cntr <= last; ++cntr){ intlsbs = keylsbs | cntr; trialKey[28] = (byte) (lsbs >>> 24); trialKey[29] = (byte) (lsbs >>> 16); trialKey[30] = (byte) (lsbs >>> 8); trialKey[31] = (byte) (lsbs ); cipher.setKey(trialKey); cipher.encrypt(plainText, trialciphertext); if (match(ciphertext, trialciphertext)){ foundKey = new byte[32] System.arraycopy(trialkey, 0, foundkey, 0, 32); } } . . . if (foundKey != null) System.out.println(Hex.toString(foundkey)); Would like to quit this thread, other threads in the same node, and other nodes early, when the correct key is found

  9. Improvement: Sizeup for (intcntr = first; cntr <= last; ++cntr){ intlsbs = keylsbs | cntr; trialKey[28] = (byte) (lsbs >>> 24); trialKey[29] = (byte) (lsbs >>> 16); trialKey[30] = (byte) (lsbs >>> 8); trialKey[31] = (byte) (lsbs ); cipher.setKey(trialKey); cipher.encrypt(plainText, trialciphertext); if (match(ciphertext, trialciphertext)){ foundKey = new byte[32] System.arraycopy(trialkey, 0, foundkey, 0, 32); } if (foundKey != null) System.out.println(Hex.toString(foundkey)); Would also like to extend the size of N beyond 30 bits

More Related