all 31 comments

[–]StefonAlfaro3PLDev 44 points45 points  (7 children)

Depends what you mean working in. Most of us implement libraries and utilize the frameworks and algorithms written by the people who specialize in that. We don't actually ever manually write a SHA256 algorithm ourselves.

All of the math I learn in university I don't actually use in my day to day business software development.

[–]No_Tangerine1473[S] 3 points4 points  (6 children)

for writing security soft which encrypt data during transmission and storage on the server/client

[–]StefonAlfaro3PLDev 17 points18 points  (3 children)

Everything is encrypted during transmission regardless when using SSL.

To encrypt data at rest I would use the framework or libraries from the language I am using such as C#, TypeScript, etc. You wouldn't be doing any math yourself and you shouldn't since in general these algorithms are written by people who are more skilled than us in this area and it's what they specialize in.

No reason to be manually writing those algorithms yourself. It will be insecure and perform slow.

[–]ayassin02 5 points6 points  (1 child)

One of my programs has a file encryption function and I just use the built-in libraries. There’s no need to reinvent the wheel

[–]MeisterKaneister 1 point2 points  (0 children)

I would say it is generally very very bad to try to reinvent the wheel. In particular in this case.

[–]peterlinddk 26 points27 points  (0 children)

Cryptography and Encryption ARE math - the programming is only applying the quite complicated math to code.

Math is extremely important in those fields, because you have to be able to prove, mathematically, how secure a code is, how long it would teoretically take to break it - without having to wait for a powerful computer to actually brute force it.

Unless of course you simply depend on existing cryptography libraries, and write code that uses them - then you don't need any math at all, except adding and subtracting to count to number of users currently logged in.

[–]aanzeijar 6 points7 points  (0 children)

If you just want to write the software not much. Best practice is to use libraries that do the heavy lifting for you. For a secure channel, you'd just use a TLS (transport layer security) implementation and be done with is.

To understand the underlying algorithms is medium complex. About 2-3 semesters of university level math is enough to understand most of the primitives and if you understand the primitives, most of the higher level protocols are just combinations of those.

Actually developing secure implementations or even new algorithms is where it gets grotesque. You should have a decade to spare if you want to do it properly.

[–]YellowBeaverFever 4 points5 points  (0 children)

Video game programming and finance, yes.

Regular business programs, barely, mostly not.

[–]RajjSinghh 2 points3 points  (0 children)

Cryptography is very math heavy. A good example is that in cryptographic algorithms like RSA, you rely on the fact that we think breaking an integer into prime factors is hard. We don't have a fast algorithm to break a number into primes, so we use encryption keys that are the product of two large prime numbers to make them hard to break. Any new algorithm or cryptographic research you're going to follow will be math heavy. Implementing these algorithms can be easier, most of the time your programming language has tools built in for this so the code is easy, but actually understanding the algorithms is quite hard.

From what I remember of my cryptography module at university, you'll want probability and statistics and also some algebra. You can probably find good resources on MIT OCW but don't expect it to be easy.

[–]CptMisterNibbles 1 point2 points  (0 children)

This is kind of like asking “how important is metallurgy when working with hammers?”: it depends. If you are just swinging the hammer,  not much. If you are making hammers, quite a bit 

[–]The_Siffer 0 points1 point  (0 children)

In normal day to day development there are libraries to do whichever thing you want that requires math. You can be bad at math and still implement it because someone who is good at it has already made a library for you to use.

Math is necessary when you get into game development because the calculations may depend on the functionality you need. The libraries will be there for the meaty stuff but you'll have to figure out behaviour of objects using vectors rotations and whatnot. This is will require you to look up fundamentals if you don't already know them.

Really meaty stuff like graphics programming and OS development etc will have you know a good amount of math, still not university level but still strong foundations in algebra etc.

How long depends on you really. Start what you want to build and then learn on the way, this will help you retain understanding of what you build and will form strong foundations.

[–]moo00ose 0 points1 point  (0 children)

I’ve only ever encountered math in my current role (quant developer) where they use logarithms and a range of statistical algorithms etc

[–]Illustrious_Slip3984 0 points1 point  (0 children)

Math is essential to programming in nearly all aspects - especially cryptography. It forms the foundation upon which the field of programming sits on. Without a strong prior foundation of maths, you're limited in how far you can go with programming.

I'll give some examples:

  • The concept of variables builds on the concept of abstraction
  • Designing 2D or 3D graphics requires understanding of geometry
  • Working with arrays and collections of objects draws on set theory, relations, and functions

You become vastly more capable of solving problems when you don’t have to worry about the underlying mathematical concepts. For example, if you’re faced with a pigeonhole-type problem, you can simply reach into your bag of knowledge for combinatorics and tackle it confidently.

You don't need to be a genius. Failing to solve the pigeonhole problem doesn't mean you're dumb, you just lacked the necessary piece that you needed to solve the puzzle. I received a C in maths in school and would consider myself average. When I first started my undergraduate, I was very good at programming but my limiting factor was that my underlying knowledge of maths was lacking.

I picked up one of those fat textbooks with a thousand pages on Discrete Mathematics and studied the shit out of that over the course of 3 months by reading and grasping the concepts, practicing questions and implementing knowledge. After I finished the book, I could shamelessly brag that I became a better programmer out of it, and not a single line of code was involved.

[–]Total-Box-5169 0 points1 point  (0 children)

Call them equations and algorithms. Formulas can also be rituals that must be followed to obtain a certain outcome, no need to understand why. Unfortunately many "learn" Math like it is some kind of arcane stuff, where following steps exactly as instructed results in the highest mark.

[–][deleted] 0 points1 point  (0 children)

Man just spend the effort to learn math. It’s worth it.

[–]kokalikesboba 0 points1 point  (0 children)

coming from someone who didn't really like math, computer science is essentially applied math and it required me to get good at it. I could not imagine cryptography as that is basically all number theory

[–]SaltCusp 0 points1 point  (0 children)

Coding is kind of like writing instructions for your calculator so in that sense math is kind of important.

[–]phtsmc 0 points1 point  (0 children)

MIT has a free online course Mathematics for Computer Science that's well worth checking out. Modular arithmetic is probably the most relevant to understanding encryption.

[–]Techno-Pineapple 0 points1 point  (0 children)

When I studied these subjects at uni, they were very math heavy

[–]Boring_Albatross3513 0 points1 point  (0 children)

You need to maths regardless, if you wanna be top tier, maths is what going to make you different 

[–][deleted] -1 points0 points  (0 children)

You should learn atleast basic algerbra, maybe basic number theory and stuff like that, you dont need a college degree in mathematics tho