# I made an encryption device for school how can I make it better? [closed]

(All programmed in Visual Basic) How it works is it gets a random number from 1 to 30000 and changes the first character by it in Unicode then it uses that number to change the first character of the key then it gets a new random number and repeat so that the key is entangled in to the end result. Which is how it is decrypted by guessing the number for each of the key values till it is the same as what we know the key should look like the then the corresponding letter from the message is decrypted with the same number. Boy is it hard to explain and I am bad at writing I will link to the git hub when I do it https://github.com/VeryG00dName/Encrypter

The folks here aren't keen on performing analyses of encryption algorithms, and a load of code in git doesn't help much with that either unfortunately.

What I would say though is that you seem to have yourself a stream cipher. Have a look at chapters 5 & 6 of Handbook of Applied Cryptography.

One of the issues will be your random numbers. Consider that any computer can easily just try all 30,000 of them sequentially until the message makes sense. We can just do this and it's called a brute force attack.

• Thank you. I thought since each character is encoded by a new random number that it would take a long time plus you could just run it through the program more than once.
– Alex
Jun 30, 2019 at 22:17
• @Alex Yes, but consider where the random numbers come from. Chances are they stream one after another depending very obviously on the previous one. See what a cryptographically secure random number generator is, and how to start one off (seeding). If you're using one already you probably need a totally different question :-) Jun 30, 2019 at 22:32
• @Paul Uszak There is a very good reason that some of the folks here are not good at performing an analysis of cryptographic algorithms. Schneier's book, though good, has gotten old. No one has created an updated encyclopedic reference that clarifies the whole picture. Jun 30, 2019 at 22:51
• @Patriot I'm sure that you're right. It's just that I consider this type as some of the most important questions on the whole site. A new user has show an active and practical interest in crypto. It's right to help and encourage, even though I agree that we can't parse much code. I think of the handbook as part of a crypto customer acquisition toolkit. Is there really nothing more recent? An opportunity then for Schneier Edition 2? Jun 30, 2019 at 23:54
• @Paul Uszak One of you needs to get busy. Fame awaits! Joking aside, someone needs to write a clear and comprehensive book on cryptography that can update and replace Mr. Schneier's venerable tome. Jul 1, 2019 at 0:58