Archive

Author Archive

Day 25 — New Crypto Hash #5 (Final)

November 16th, 2020 Comments off

Hey, all! Welcome to CryptoCL.

Over the past several days, I had tried to develop the new cryptographic hash. However, with being very busy with other assignments, I was unable to get very far in my efforts. I kept getting stuck on mistakes that I think a more fresh eyes and fingers could fix much more quickly than I could.

However, that isn’t to say I’m not proud of my work. I was able to strive to develop something new — something that might have not been made before. Although I couldn’t finish, I am certain that it would help me in the long run.

With this experience nearly wrapping up, I have to present my findings in a presentation. I found that it is possible to implement OpenCL into BLAKE2, but doing so with greatly affect the performance of the hashing algorithm. Moreover, the OpenCL standard would not be fully utilized — as BLAKE 2 is sequential in nature.

By the end of the week, I will post my next, and final, post to this blog. I will discuss in greater detail my findings and thoughts on this project.

Thank you for reading!

Kyle Jenkins

Time spent today: 4 hours 30 minutes
Total Time: 40 hours 30 minutes

Categories: Uncategorized Tags: ,

Day 24 — New Crypto Hash #4

November 10th, 2020 Comments off

Hey, all! Welcome to CryptoCL.

I showed Dr. Marmorstein my cryptographic hash. It seems that the permutation step was not actually permutation, but a complicated substitution step. I have since written a simple permutation step.

When I ran the program with user input, the program would spit out undecipherable garbage. However, I was told this is a good thing, so I will keep it.

I have since begun to write a program to calculate the confusion. However, given how I’m writing it, it would seem I would need to do a complete overhaul of my program in order to do this. I am not looking forward to this, and it feels like a lot and I’m not sure where to go with it.

I will keep trying, but if I can’t make a successful breakthrough by the weekend, I am most likely just try and implement the program using the OpenCL standard, so that I have at least a working OpenCL program.

Kyle Jenkins.

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

Categories: Uncategorized Tags: ,

Day 23 — New Crypto Hash #3

November 8th, 2020 Comments off

Hey, all! Welcome to CryptoCL.

The cryptographic hash algorithm is complete. It’s not the best or most secure, but the input is being successfully encrypted.

I changed my permutation algorithm to check the substituted number. If the number is between 64 and 91 (A-Z in ASCII), then the value of the unsigned int pointer n at i will be changed to the BLAKE2s SIGMA value at row i mod 10, and column of the value of the unsigned int pointer o mod 16 + 64. This plus 64 will help the new value of n at i to be at least A. Otherwise, it’s the same value of BLAKE2s SIGMA, but with an addition 96.

The program now splits the message into 16 byte blocks, substitutes each individual byte, permutes each byte, and substitutes again, and repeats until finally printing out the result.

One issue that arises of the algorithm security-wise is that, when the remaining bytes are zeroed out, and whenever you run the program with zeroed out bytes, you will easily be able to see which bytes are zeroes. There’s a specific pattern that appears regardless of the message at the end of the last 16 byte block with zeroes.

However, I am quite proud of my algorithm. Although it’s not the best, the letters are changed depending on their location, which means it will be difficult to crack in a marginally short amount of time, at least by hand.

Tomorrow, I am speaking with Dr. Marmorstein to discuss incorporating OpenCL into the algorithm. I feel pretty good about this!

Until next time!

Kyle Jenkins

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

Categories: Uncategorized Tags: ,

Day 22 — New Crypto Hash #2

November 6th, 2020 Comments off

Hey, all! Welcome to CryptoCL.

Progress on the new Cryptographic hash is slow going. I am working to try and implement the non-OpenCL implementation by Monday.

Right now, I have the substitution and permutation functions defined. The substitution function is a simple one, where you return the given unsigned char + 1 and modulate by 256.

The permutation function, however, is causing the most problems. I want to implement the BLAKE2s SIGMA variable if possible. The B2s SIGMA is a large 10×16 uint8_t variable, mapping numbers of 0 to 15 to each of the 10 rows:

static const uint8_t blake2s_sigma[10][16] =
{
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
{ 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } ,
{ 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } ,
{ 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } ,
{ 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } ,
{ 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } ,
{ 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } ,
{ 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } ,
{ 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } ,
{ 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } ,
};

However, it seems to be causing some problems — more specifically, it seems that attempts to substitute after the permutation (a test to see if the code is currently working) only spit out garbage.

I will continue to work on improving the algorithm. The hope is to have it in working order by Monday, then, OpenCL implementation is the next step. Thank you!

Kyle Jenkins.

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

Categories: Uncategorized Tags: ,

Day 21 — New Crypto Hash #1

November 1st, 2020 Comments off

Hey, all! Welcome to CryptoCL — and I hope you had a Happy Halloween!

Today, I began implementing our own Cryptographic Hash. The goal it take a given message, split it into 16 bytes (and adding filler to the remainder bytes to make it size 16), and split it further into 1 byte blocks. We then take the 1 byte blocks and perform a substitution and permutation equation onto it. Next, we combine the 1-byte block with the next 1-byte block, so we have all 2-byte blocks, and perform another substitution along with transposition function. We continue this by combining into 4, 8, and then back to 16. Once we’re back to 16-byte blocks, we’ll XOR this block with the next block, and repeat until we reach the end of the message.

At the moment, I have a simple implementation of the basic algorithm. There is no substitution, permutation, or transposition algorithms yet — that will come later. There is also no OpenCL code yet, as I wanted to get the basic algorithm finished before I started using the OpenCL standard.

Next time, I have a meeting with Dr. Marmorstein, and we will most likely discuss how to improve the code and how to make the functions unique.

Until next time!

Kyle Jenkins

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

Categories: Uncategorized Tags: ,

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: ,