How to make a encryption function?
Is posible create a simple function to encrypt without difficulty?
Encryption the regular type we all know is a tiny bit difficult to implement as you need domain specific knowledge in maths and crypto. https://www.tutorialspoint.com/cryptography/index.htm Loop up 'how to write ciphers', 'encryption algorithms' Then check the basic ones like the caesar cipher. That should give you a rough idea of the same.
sure, all your codes for the encryption will be in a function