Archive

Archive for October, 2020

Day 20 — Crypto Research #2

October 24th, 2020 Comments off

Hey, all! Welcome to CryptoCL.

Today was a short day of research — I delved deeper into researching the Data Encryption Standard (DES) and Advanced Encryption Standard (AES) cryptographic algorithms. Most of my time went into the AES algorithm, however.

I looked up the FIPS publications for both DES and AES, and also looked into a tutorial of the AES algorithm, to give me a general idea of how the algorithm works. It also helps that I was able to refer to my notes from when I took a Cryptography class.

AES utilizes four main functions:

  1. Byte Substitution — Substitute the input (present as a byte) , 16 input bytes at a time.
  2. Shift Rows — Shifting the rows of the 16 substituted byte input to the left.
  3. Mix Columns — Takes each column of the 16 byte substituted and shifted input, and transforms them based off a given function.
  4. Add Round Key — Take the 16 substituted, shifted, and mixed input bytes, translated them to 128 bits, and XOR them by the 128 bit round key.

Normally, this operation could take a very long time to process, especially with larger messages or data. That being said, I believe that OpenCL could easily split up the four functions for each 16 byte input into independent operations to be done by the GPU. As discovered when first attempting to implement OpenCL, the standard cannot be utilized effectively when the input is being overwritten in the kernel and then used elsewhere within the same function. However, functions 1, 2, and 4 do not utilize overwritten other parts of the input when calculating the output in each function, so this should allow OpenCL to optimize the calculation.

Tomorrow, I will look over my projects I had written when taking the Cryptography class, and get a better look at how AES operates.

Until next time!

Kyle Jenkins

Time spent today: 1 hour
Total Time: 29 hours 30 minutes

Categories: Uncategorized Tags: ,

Day 19 — Crypto Research #1

October 20th, 2020 3 comments

Hey, all! Welcome to CryptoCL.

I spoke with Dr. Marmorstein very briefly last Friday about the research I had done on clblake. I’m going to add my notes onto the previous blogpost. Again, they’re just notes that try and make sense of what is going on under the hood of the program.

More importantly, I started to do some research in an attempt to develop our own Cryptographic hashing algorithm. As a short and sweet refresher on Cryptographic algorithms, I found a website called Crypto-IT that discusses how certain algorithms work. I determined that the best kind of algorithm to use would probably be some form of Block Cipher. This is so that we can easily split up the given message into blocks, and perform the encryption or decryption with every block. This would definitely not be a secure algorithm, most likely, as we would probably have to use one constant key for each block. However, as far as speed is concerned, it should definitely speed up the algorithm by removing the tedium of processing each block once at a time.

There is still more studying to be done! I plan to look more in-depth into the AES and DES algorithms, as they are block algorithms and were (and still are) widely used.

See you next time!

Kyle Jenkins.

Time spent today: 1 hour 15 minutes
Total Time: 28 hours 30 minutes

Categories: Uncategorized Tags: ,

Day 18 — clblake Research

October 11th, 2020 Comments off

Hey all! Welcome to CryptoCL.

A bit of a short day today, as far as this research project, at least. I spent about an hour to 90 minutes researching clblake. I went through the program and looked at how wfr was able to accomplish parallelism with BLAKE256. A lot of the code is setting up things for the program to utilize and calculate into the hashing function. A lot of blake256 functions were also translated into the blake256.cl file, to be used by the kernel. There is a lot of moving parts when it comes to this blake256 implementation.

Tomorrow, I will discuss with Dr. Marmorstein about the notes I took, and figure out where to go from there.

Thank you!

Kyle Jenkins.

Time spent today: 1 hour 15 minutes
Total Time: 27 hours 15 minutes

Edit 10/20/2020: Here are the notes I took on the clblake project:

Loader Loading...
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

Day 17 — Tutorials, Again #6

October 9th, 2020 Comments off

Hey all! Welcome to CryptoCL.

As we’re nearing the final days of working on the Hands-On OpenCL tutorial, I am wrapping up Exercise #09. On Thursday, I was able to resolve the issues I was facing with getWorkGroupSize and getInfo. Both problems were resolved by declaring and assigning a cl::Device, instead of using the DEVICE defined variable.

The program began to seg fault after these issues were resolved and I was able to program the code. The cause of the seg faults appeared to be some issues of some un=assigned values, values that were not assigned correct values, and filling a vector that would hold the partial sums of the program was being assigned the incorrect amount of items. After fixing these assignments and removing the for loop to fill the vector, the program runs to completion, but does not return the right value.

I met with Dr. Marmorstein to discuss the solution and, after digging through the code, we discovered that a value “nwork_groups” was not being initialized before the partial sum vector was being created, so the vector was being initialized as a vector of a null size. Switching around the order of code allows for the program to run and print the correct value of pi.

Lastly, during this same meeting, my next plan of action was made clear — I am to study a project found on GitHub called clblake. It is an implementation of an older version of BLAKE using OpenCL. Having a look at how GitHub user wfr handled implementing the cryptographic algorithm can offer insight on how we can implement our own implementation.

Until next time!

Kyle Jenkins

Time spent today: 2 hours 30 minutes
Total Time: 26 hours

Day 16 — Tutorials, Again #5

October 6th, 2020 Comments off

Hey, all! Welcome to CryptoCL.

After meeting with Dr. Marmorstein, we’re putting in a bit more time into the Hands-On OpenCL tutorials. I’m still working toward solving Exercise 09 — using the given solutions in the git repository.

Going through and implementing the solution, I’m running into an issue with some of the command that the solution uses. The commands are a function called “getWorkGroupInfo”, called by the kernel, and “getInfo” called by the OpenCL device. It seems to think that getWorkGroupInfo has no matching function, but this is not true since the solution calls this function. The second error, however, might be an issue that DEVICE is a defined variable, and does not match the cl::Device object that calls the function. I have some ideas in mind to fix it, but that is for another day.

I’ll continue to work on these throughout the week, until I meet with Marmorstein about designing our cryptographic algorithm to use that is compatible with OpenCL.

Until next time!

Kyle Jenkins

Time spent today: 2 hours
Total Time: 23 hours 30 minutes

Categories: Uncategorized Tags: ,