How can I write an encryption algorithm?

Like write one from scratch, or use an existing algorithm?

Writing one from scratch...I'd suggest you get your Master's or Doctorate in Mathematics/Cryptography first :).

Seriously though...encryption is a big deal nowadays, and generally not recommended to just try and write your own. Encryption is a complicated thing, and it's usually best to use a "proven" encryption algorithm.

To use an existing encryption algorithm in VB.NET, you can look into the Cryptography class:
https://msdn.microsoft.com/en-us/library/0ss79b2x(v=vs.110).aspx?f=255&MSPPError=-2147217396
 
I'm really trying to get into the field but I'm not sure how I would be able to build a history or something along the lines of getting a feel for it before actually pursuing an in depth education for it. Does this make sense or not?


--
 
I guarantee you, any crypto scheme that you build from scratch WILL be incredibly vulnerable to many, many different, widely known attacks. Crypto schemes depend on some very heavy mathematics, and as Carnage said, unless you have a doctorate in mathematics and/or crypto, stick to the existing, proven algorithms.

I've been watching lectures from a bachelor's program out of Germany, put out by the University of Bochum, and the instructor has given example after example of schemes his former students have put together that utterly fail when tested against some fairly simple attacks, and these are college grads.

But to answer your original question, the absolute most fundamental part of many encryption schemes is the Xor operator (or Modulo 2, for math gurus).

XOR-ing your data with a 'key' that you pick is a very simple "encryption" method. I say 'encryption' in quotes, because it's more of an obfuscation step than it is encryption. It provides virtually no cryptographic strength, but it does obscure the plaintext to anyone who's not determined enough to decrypt the ciphertext, which is relatively easy in this scheme.

I have a project on my Github page that does exactly this, if you'd like to take a look at it.
 
Last edited:
I'm really trying to get into the field but I'm not sure how I would be able to build a history or something along the lines of getting a feel for it before actually pursuing an in depth education for it. Does this make sense or not?


--

Like I said, you'll want degree(s) in Math/Crypto - that's going to be the primary way to get into this particular field.

Note there's a difference between Security field and something like Encryption/Cryptography.
 
The thing with encryption is that you want the data you encrypt to have as little consistency as possible. Anyone good enough can look at poorly encrypted data and observe consistencies that can strongly indicate what method was used to make that data encrypted. A truly great encryption relies heavily on a foundation of seemingly randomness even though randomness does not exist in the mathematical realm.

As has been said above, you'll need to understand the rudimentary concepts of cryptography before you'll understand a slight inkling of effective encryption methods.
 
Back
Top Bottom