I'm working on an elevator project just for fun, it's actually hardware. But I think this is more of a software issue. I do not need to have this function, in fact it is completely redundant, but I was curious, so I add it anyway so that I can find out: P
I have an 8-bit address, an 8-bit data bus, and an 8-bit encryption code. I have a master and many slaves. The master knows the address of subordinates and knows the encryption code. Slaves also know their address and encryption code.
I need a really simple algorithm that:
The master sends "y", where y = function (data, encryption code) The slave receives "y" and can retrieve data from data = function2 (y, encryption code)
I tried to play with AND, XOR, OR, etc. and their combinations, but could not understand.
Again I am looking for simple algorithms. If you don't mind, you can do me a great service and explain some theory about how I can come to such a solution / functions.
Thank you very much!
source share