Help please - encryption formula

Discuss anything interesting but not remotely Countdown-related here.

Moderator: Jon O'Neill

Post Reply
User avatar
Jon Corby
Moral Hero
Posts: 8021
Joined: Mon Jan 21, 2008 8:36 am

Help please - encryption formula

Post by Jon Corby »

Does anyone have a "simple" formula for encrypting a number? I want to disguise a column in a table (wage cost per hour) so that people browsing the table can't easily see the true value. It doesn't really need to stand up to any attempts to hack, but for the values n1,n2,n3 I'd like it be not obvious what they are, and that n1 > n2 > n3. (Equal values would equate to the same encrypted value I guess, but that's not really an issue.)

I'd really like this just to be a single line formula to make it easy to use, as I don't want an obvious encryption/decryption routine - nobody else but me and my manager will know what this value represents and that it's even encrypted. This means I'm anticipating the encrypted value to also be a number, but I'm open to any suggestions.

Thanks in advance :)
User avatar
Michael Wallace
Racoonteur
Posts: 5458
Joined: Mon Jan 21, 2008 5:01 am
Location: London

Re: Help please - encryption formula

Post by Michael Wallace »

Convert first letter of employee name to a number (A = 1, B = 2, etc.), add/subtract this from the wage? Could pick any letter in their name this way to make it less decipherable (although this won't keep the same numbers the same for different people). Probably neater solutions but that was my first thought.
User avatar
JimBentley
Fanatic
Posts: 2820
Joined: Fri Jan 11, 2008 6:39 pm
Contact:

Re: Help please - encryption formula

Post by JimBentley »

How about choose a 10-letter word with no repeating letters (e.g. TRAMPOLINE) and map the numbers 0-9 with that word, e.g.

Code: Select all

0 1 2 3 4 5 6 7 8 9
T R A M P O L I N E
So £12.75 would be RAIO, £12.34 would be RAMP, £8.50 would be NOT, etc. etc.
Bob De Caux
Enthusiast
Posts: 265
Joined: Wed Sep 09, 2009 3:18 pm

Re: Help please - encryption formula

Post by Bob De Caux »

I presume this is in Excel? If you divide everyone's hourly wage by 1000, add a random number x and then format the column as Date, everyone's entry will just show the same date, which you can choose via x (e.g x = 41,000 gives everyone the date 01/04/2012). Pretty unlikely anyone would try formatting back to number unless they knew about it, but you can do it whenever you need to recover the info.
User avatar
Jon Corby
Moral Hero
Posts: 8021
Joined: Mon Jan 21, 2008 8:36 am

Re: Help please - encryption formula

Post by Jon Corby »

Bob De Caux wrote:I presume this is in Excel? If you divide everyone's hourly wage by 1000, add a random number x and then format the column as Date, everyone's entry will just show the same date, which you can choose via x (e.g x = 41,000 gives everyone the date 01/04/2012). Pretty unlikely anyone would try formatting back to number unless they knew about it, but you can do it whenever you need to recover the info.
Sorry no, it's a column in a database table.

Jim's idea has two main negatives - it's difficult to encode encryption/decryption in a single line, plus it's also fairly apparent from the length that one person earns more than another. FFS, what the hell were you thinking?

I quite like extending Coon's idea to encrypting x with the formula ax+b, where a & b could be the 2nd and 5th (for example) characters of the logon. That will still leave me with a simple single line formula for both encryption and decryption, and I reckon a suitably encrypted set of data such that anybody stumbling upon it wouldn't be able to see anybody's hourly rate, or whether person A earned more than person B.

Cheers guys. Except Jim.
User avatar
JimBentley
Fanatic
Posts: 2820
Joined: Fri Jan 11, 2008 6:39 pm
Contact:

Re: Help please - encryption formula

Post by JimBentley »

Jon Corby wrote:Jim's idea has two main negatives - it's difficult to encode encryption/decryption in a single line, plus it's also fairly apparent from the length that one person earns more than another.
Well, I imagined that you poncy fucking southern twats all earned over £10.00 per hour anyway, so it shouldn't really matter. Although I suppose some of you cunts probably earn more than £100.00 per hour, so the same problem would apply.
Jon Corby wrote:FFS, what the hell were you thinking?
Sorry Jon. I'll try to do better next time, I promise.
User avatar
Jon Corby
Moral Hero
Posts: 8021
Joined: Mon Jan 21, 2008 8:36 am

Re: Help please - encryption formula

Post by Jon Corby »

JimBentley wrote:Sorry Jon. I'll try to do better next time, I promise.
Just don't bother.
User avatar
JimBentley
Fanatic
Posts: 2820
Joined: Fri Jan 11, 2008 6:39 pm
Contact:

Re: Help please - encryption formula

Post by JimBentley »

Jon Corby wrote:
JimBentley wrote:Sorry Jon. I'll try to do better next time, I promise.
Just don't bother.
But the only reason I carry on living is in the remote chance that something I may do in the future might please you! Should I kill myself?
User avatar
Jon Corby
Moral Hero
Posts: 8021
Joined: Mon Jan 21, 2008 8:36 am

Re: Help please - encryption formula

Post by Jon Corby »

JimBentley wrote:
Jon Corby wrote:
JimBentley wrote:Sorry Jon. I'll try to do better next time, I promise.
Just don't bother.
But the only reason I carry on living is in the remote chance that something I may do in the future might please you! Should I kill myself?
Well kind of yes, but then you killing yourself would displease me immensely. It's quite the paradox.
Post Reply