Simple encryption of numeric data

I realise this may be a lazy question when there’s so much information out there but that’s partly the problem!

I have a database app that will only be used by a very small, select and trusted number of individuals within our company but the database itself can be accessed by a few others (our web developers as it happens). Whilst we trust them implicitly with our data, there are a few tables of financial data that I’d like to store in the same DB that we’d prefer that they couldn’t read easily (just the dollar numbers in the invoice data - nothing world shattering).

So all I want to do is convert decimal numbers (say 1234.56) to an encrypted state (and back again) using a long password as the key. The password will be entered in the desktop Xojo app whenever one of the users wants to access the ‘Finance’ area of the app. It will never be transmitted over any network and will be OSX only if that makes a difference.

I know a little about salts and passwords from playing about in CakePHP but here I just need something to stop casual prying. It doesn’t have to be miltary grade!

What method would you suggest I look into that would be easy in a Xojo desktop app?

Thanks.

Why not just encrypt the database?

Okay backing up a bit I realize that I don’t really know what database you are using.

Some databases have the ability to have fields encrypted separate from the database.

If you want to do it all in code this should get you where you want to go:

http://documentation.xojo.com/index.php/Crypto.RSAEncrypt

http://documentation.xojo.com/index.php/Crypto.RSADecrypt

It’s a MySQL database. But thanks for your reply - I’ll look into RSA even thought that may be OTT for what I need - I just want something like the “invoice_amount” field to be a hex string rather an open number that someone can read easily.

If you want obfuscation instead of encryption try these:

http://documentation.xojo.com/index.php/EncodeBase64

http://documentation.xojo.com/index.php/DecodeBase64

Wouldn’t it be easier to make users for your web development group that just don’t have access to those tables/fields?

Thanks (and possibly apologies) to all. I’m ashamed to say I didn’t didn’t realise there was such a thing as AES_ENCRYPT / DECRYPT avaible right within MySQL which is perfect for my needs.