Hey guys. I am frustrated with DS. Its hellish. I like networking though and network security. I wanted to know to know cryptography do you need to know data structures and algo very well?

# Cryptography and data structure

Page 1 of 1## 4 Replies - 1467 Views - Last Post: 14 November 2014 - 08:45 AM

##
**Replies To:** Cryptography and data structure

### #2

## Re: Cryptography and data structure

Posted 12 November 2014 - 12:19 PM

That's awfully vague. In theory you do not need a computer to do crypto, or you can even use a deck of cards *cough* cryptonomicon */ cough* .

### #3

## Re: Cryptography and data structure

Posted 12 November 2014 - 12:20 PM

Data structures are kind of a base for CS. You will need to know them for basically anything you are going to do in the field.

Cryptography typically compresses the message first to reduce the amount of repeated data. Most cryptography methods use a tree, or list, or vector, or some other data structure. Networking also has a ton of data structures in it. If you want to even open a socket connection you need to get a socket pointer, which stores different data depending on the type of socket, and platform.

Basically everything revolves around data structures and using them appropriately.

Algorithms are also a very important part of CS. You need to be able to come up with an algorithm that solves your problem in a suitable amount of time. For instance, you could write a fast encryption algorithm that is very heavy on the complexity side, or you could write a really slow algorithm that is fairly light-weight (on the algorithm complexity). If the slow algorithm takes days to complete then it is useless in real-world applications (this is exaggerated, but you get the point).

So, in general, yes data structures and algorithms are fundamental.

Cryptography typically compresses the message first to reduce the amount of repeated data. Most cryptography methods use a tree, or list, or vector, or some other data structure. Networking also has a ton of data structures in it. If you want to even open a socket connection you need to get a socket pointer, which stores different data depending on the type of socket, and platform.

Basically everything revolves around data structures and using them appropriately.

Algorithms are also a very important part of CS. You need to be able to come up with an algorithm that solves your problem in a suitable amount of time. For instance, you could write a fast encryption algorithm that is very heavy on the complexity side, or you could write a really slow algorithm that is fairly light-weight (on the algorithm complexity). If the slow algorithm takes days to complete then it is useless in real-world applications (this is exaggerated, but you get the point).

So, in general, yes data structures and algorithms are fundamental.

### #4

## Re: Cryptography and data structure

Posted 12 November 2014 - 10:52 PM

Quote

I wanted to know to know cryptography do you need to know data structures and algo very well?

Cryptography relies more on the algos side than the data structures side. Though really, you'll want to be a number theorist and an algebraist to do cryptography. Abstract algebra has a very similar feel to data structures, though. So if you don't like DS&A, you probably won't be too fond of Cryptography beyond the basics. Other related topics like coding theory and information theory come up in crypto. An easy example of where data structures would fit in is with a Huffman coding.

If you're into network security, you can focus more on the operating systems and computer organization side vs. the cryptography side. I think you will find that more enjoyable.

### #5

## Re: Cryptography and data structure

Posted 14 November 2014 - 08:45 AM

csstudent123, on 12 November 2014 - 02:08 PM, said:

Hey guys. I am frustrated with DS. Its hellish. I like networking though and network security. I wanted to know to know cryptography do you need to know data structures and algo very well?

Simply put: yes. You need to understand algorithmic analysis to understand what makes a cryptosystem secure. This depends critically on the difference in time complexity between the processes that do encryption and decryption, particularly decryption with and without knowledge of the key: basically, you need to be able to prove that you can encrypt a stream of data in reasonable time so that the encrypted text can be decrypted in reasonable time by someone who knows a secret, and cannot be decrypted in reasonable time without knowing that secret.

Furthermore, if you want to work on networks I would think you'd need a good understanding of graphs and the algorithms that work on them.

I think you're best off if you knuckle down and understand this material. That being said, there are many people making a living all over the tech sector who don't understand the fundamentals of the stuff they're working on, so it's possible that you could get by on charm alone - it's not uncommon.

Page 1 of 1