Topic: Simple encryption please

Folks,
   quick question - anyone recommend a simple to implement encryption capability in AS2 e.g.
Import library
encrypt (value, key)
decrypt (value, key)

I have tried a few of the net but there are always a few problems and as others have already done this don't want to e invent the wheel.

cheers

Nigel

smile smile smile

Re: Simple encryption please

Hello Nigel.

While I have not really done any Flash coding for the device, you may be able to use the functions listed at http://wiki.chumby.com/mediawiki/index.php/ChumbyNative :

static var _blowfishEncrypt:Function = _global.ASnative(5,163); // (plain:String,key:String[,mode:String]):String
static var _blowfishDecrypt:Function = _global.ASnative(5,164); // (crypto:String,key:String[,mode:String]):String

It's stated there that some of those functions are exclusive to the control panel/master instance, but it could be worth a shot.

Most of the problem with effective encryption is key exchange. You stated in the other thread that you wanted a symmetric algorithm so unless your key is never transmitted it would end up being something static that could easily be discovered by anyone that could get your app. In the event that you just want something to be non-plaintext over the net without concerns of decryption with a known key, you could always throw together a simple XOR cipher without much issue.

There are a few AS2 libraries out there that I can see with a quick Google search. It takes registering, but one is: http://www.kirupa.com/forum/showthread.php?t=289672

Re: Simple encryption please

devOut wrote:

Hello Nigel.

While I have not really done any Flash coding for the device, you may be able to use the functions listed at http://wiki.chumby.com/mediawiki/index.php/ChumbyNative :

static var _blowfishEncrypt:Function = _global.ASnative(5,163); // (plain:String,key:String[,mode:String]):String
static var _blowfishDecrypt:Function = _global.ASnative(5,164); // (crypto:String,key:String[,mode:String]):String

It's stated there that some of those functions are exclusive to the control panel/master instance, but it could be worth a shot.

Most of the problem with effective encryption is key exchange. You stated in the other thread that you wanted a symmetric algorithm so unless your key is never transmitted it would end up being something static that could easily be discovered by anyone that could get your app. In the event that you just want something to be non-plaintext over the net without concerns of decryption with a known key, you could always throw together a simple XOR cipher without much issue.

There are a few AS2 libraries out there that I can see with a quick Google search. It takes registering, but one is: http://www.kirupa.com/forum/showthread.php?t=289672

devOut,
     thanks for the feedback I will have a look at the call. Your correct about the key issue - any serious attemtp could break it. I can go a different approach that would be bullet proof but it makes the user experience hard (edit scripts etc) which would probabaly be beyond patience of most chumby types. Will have a look athe stuff you mention - thansk for the help.

cheers

Nigel

smile smile smile

Re: Simple encryption please

If you base the key in the "_chumby_widget_instance_id", then each incarnation of the widget in each user's channels will have a different key - there simply won't be a common key for all incarnations, and the GUID for a widget instance ID isn't guessable.  It's available to both the widget and the configuration movie.

One note on the blowfish ASnative - it has a bug in the current firmware when encrypting strings > 255 characters but should otherwise work.  I *think* it's available to widgets, though I don't think we use it anywhere ourselves.