I would recommend reading
https://www.crypto101.io/Crypto101.pdf If I have an input 123 and I encrypt this to ABC, no one can decrypt but me because I know how (I have the algorithm in my head). On the other hand if you have 123 and you produce hXz and noone can decrypt it, it is pretty useless.
Usually in encryption you have a key and an algorithm.
For instance, in its simplest form , XOR
I have value 5 and key 9
0x0101 (5)
XOR
0x1001 (9)
=
0x1101 (13)
5 XOR 9 = 13
and noone, without the key, can decrypt it
but with the key 13 XOR 9 = 5
0x1101 (13)
XOR
0x1001 (9)
=
0x0101 (5)
you should well protect your key (e.g. in a wallet), so nobody can access it.
While the algorythm evolves in the last 15 years, I still recommend Arup example :
https://blogs.oracle.com/oraclemagazine/encrypt-your-data-assets Cheers
Laurent