Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //AS3///////////////////////////////////////////////////////////////////////////
- //
- // Copyright 2011
- //
- ////////////////////////////////////////////////////////////////////////////////
- package
- {
- import flash.events.Event;
- import flash.display.Sprite;
- import flash.utils.ByteArray;
- /**
- * Application entry point for BlowFish.
- *
- * @langversion ActionScript 3.0
- * @playerversion Flash 9.0
- *
- * @author Schell Scivally
- * @since 20.05.2011
- */
- public class BlowFish extends Sprite
- {
- /**
- * @constructor
- */
- public function BlowFish()
- {
- super();
- stage.addEventListener( Event.ENTER_FRAME, initialize );
- var data:String = "Here is a string to be encrypted...";
- var key:String = "asdf";
- var encrypted:String = BFHelper.encrypt(data, key);
- //CONSOLE_LOG (console.log|warn|error)
- import flash.external.ExternalInterface;
- if(ExternalInterface.available) {
- ExternalInterface.call('console.log', 'BlowFish::BlowFish()', 'encrypted:',encrypted,'\nwith key:',key);
- }
- ///CONSOLE_LOG
- //CONSOLE_LOG (console.log|warn|error)
- import flash.external.ExternalInterface;
- if(ExternalInterface.available) {
- ExternalInterface.call('console.log', 'BlowFish::BlowFish()', 'decrypted:',BFHelper.decrypt(encrypted,key));
- }
- ///CONSOLE_LOG
- }
- /**
- * Initialize stub.
- */
- private function initialize(event:Event):void
- {
- stage.removeEventListener( Event.ENTER_FRAME, initialize );
- trace( "BlowFish::initialize()" );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement