No, you seem to have a misunderstanding of how encryption and obfuscation work. Encryption provides confidentiality: a message is hidden with a mechanism using a shared secret from all parties not possessing that secret.
Obfuscation refers to a number of techniques employed to make, in general, a scripting programming language application difficult to understand to a human reader. They take as input the application in its original (human readable) form, (a key) and output a functionally equivalent application, larger in code size and far more difficult to understand.
What you describe sounds like obfuscation, not encryption.
Please do not use "invented" encryption or hashing algorithms (please read this OWASP write-up).