Let’s say I have an Access database table that has 2 columns: one is ID (from 1 to 20000, sequentially and each is unique) and one is Value (any number from 0 to 500).
How do I obfuscate the Value field (using ID or not using ID) in a simple but somewhat effective way? I expect something slightly more effective than ROT13 obfuscation but not so complicated that decoing needs more than one line of code. The decoding is done in C# code. The obfuscation is done via calculated field in Access.
I changed the “encryption” to “obfuscation” to reflect the simplicity of the goal which is NOT to prevent “attack” but only to avoid careless exposure of data.
what is your goal/attacker profile? If your requirement is anything more than stopping casual viewing you have imposible requirements… if you only care about stopping casual viewing (which is better termed obfuscation than encryption) you could try something like
b = a % 7 == 0 ? ((a/7)*991) : a % 2 == 0 ? ((a/2)*787) : a * 317and on the other end
b = a % 991 == 0 ? ((a/991)*7) : a % 787 == 0 ? ((a/787)*2) : a/317Note that this is very weak but your requirements exclude any useful form of encryption.