Writing your own Encryption algorithm? Simple answer (and I know this is a simple yes or no) is it possible to write an encryption that is 100% uncrackable, as long as I keep certain parts private? It's just for personal use.

I'm a computer programmer and need my own encryption to encrypt things like my passwords. Is this possible so that its 100% uncrackable, or is it simply not possible?
I'm a computer programmer and need my own encryption to encrypt things like my passwords. 


This does not imply that you need to write your own encryption algorithm. Being a programmer does not make you a cryptographer, cryptography is a skill unto itself that takes lots of experience and practice. 

Plenty of experienced cryptographers have gone through the trouble of designing and analyzing algorithms for people in your situation, precisely so that you don't have to write your encryption algorithm. 

More importantly

It's inappropriate to encrypt passwords. Standard good practice dictates the use of a slow, memory-hard password hashing function such as scrypt or argon2 (or pbkdf2 at the very least).

"Unbreakable encryption"


  is it possible to write an encryption that is 100% uncrackable, as long as I keep certain parts private?


The One Time Pad in theory provides information-theoretic security, which means that no amount of computational advantage or sophisticated algorithm can help an adversary who has a ciphertext learn more about the plaintext than they already know.

Using the One Time Pad in practice is clunky and prone to failure (and here's another Q/A supporting that conclusion if that was not sufficient). It is difficult to fulfill the assumptions that the proof rests upon, and so it is not used very often in practice despite the theoretical guarantees.

In practice, algorithms such as AES and Salsa20 will remain unbroken when implemented and used correctly. 

While solid encryption algorithms do exist, encrypting passwords is a poor idea.

If you want to succeed

If you care about fulfilling your security goals, then it is a good idea to stick to battle-hardened algorithms and pre-existing software libraries that implement them. Libsodium is a solid recommendation. 

Do not create your own implementation (except as a learning experience) - your information and/or your users information is at stake, and there exists a non-negligible probability of failure.