Encrypt Decrypt

Monkey Forums/Monkey Programming/Encrypt Decrypt

Raz(Posted 2012) [#1]
Does anyone know of a simple key based encrypt/decrypt function I could use with Monkey? It doesn't have to be amazingly secure, more just a deterrent from editing the .monkeystate file for a blitzMax build of a game.

Ta! :)


therevills(Posted 2012) [#2]
Diddy has a base64 module you could use.


Raz(Posted 2012) [#3]
Thanks, will give it a look :)


TheRedFox(Posted 2012) [#4]
Not too fancy (nothing AES like) but can do:

http://www.braingle.com/brainteasers/codes/index.php

Rainfence would be easy enough to do with an array

http://www.braingle.com/brainteasers/codes/railfence.php


Raz(Posted 2012) [#5]
Thanks for the links TheRedFox, I'll give base64 a look first (as it's in Monkey already!).

Therevills: is it easy for you to say which parts of Diddy I need to import to use DecodeBase64 and EncodeBase64 (so not to add everything)? That said, I recall Monkey doesn't transcode things that are never used, so can I just import all of diddy and not worry about this?

Ta :)


Samah(Posted 2012) [#6]
Base64 probably belongs in its own module. I'll look at moving it for you when I get home. Now that Monkey has some decent stream support, I should be able to finish off that missing method too :)


Raz(Posted 2012) [#7]
Awesome, thank you:)


Samah(Posted 2012) [#8]
Done. Just update to the development tip, or download the latest changeset here: https://bitbucket.org/swoolcock/diddy/get/469104ea398b.zip

https://bitbucket.org/swoolcock/diddy


Raz(Posted 2012) [#9]
Perfik, thanks