Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //AS3///////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2011
  4. //
  5. ////////////////////////////////////////////////////////////////////////////////
  6.  
  7. package
  8. {
  9.  
  10. import flash.events.Event;
  11. import flash.display.Sprite;
  12. import flash.utils.ByteArray;
  13.  
  14. /**
  15.  * Application entry point for BlowFish.
  16.  *
  17.  * @langversion ActionScript 3.0
  18.  * @playerversion Flash 9.0
  19.  *
  20.  * @author Schell Scivally
  21.  * @since 20.05.2011
  22.  */
  23. public class BlowFish extends Sprite
  24. {
  25.    
  26.     /**
  27.      * @constructor
  28.      */
  29.     public function BlowFish()
  30.     {
  31.         super();
  32.         stage.addEventListener( Event.ENTER_FRAME, initialize );
  33.         var data:String = "Here is a string to be encrypted...";
  34.         var key:String = "asdf";
  35.         var encrypted:String = BFHelper.encrypt(data, key);
  36.        
  37.         //CONSOLE_LOG (console.log|warn|error)
  38.         import flash.external.ExternalInterface;
  39.         if(ExternalInterface.available) {
  40.             ExternalInterface.call('console.log', 'BlowFish::BlowFish()', 'encrypted:',encrypted,'\nwith key:',key);
  41.         }
  42.         ///CONSOLE_LOG
  43.         //CONSOLE_LOG (console.log|warn|error)
  44.         import flash.external.ExternalInterface;
  45.         if(ExternalInterface.available) {
  46.             ExternalInterface.call('console.log', 'BlowFish::BlowFish()', 'decrypted:',BFHelper.decrypt(encrypted,key));
  47.         }
  48.         ///CONSOLE_LOG
  49.     }
  50.  
  51.     /**
  52.      * Initialize stub.
  53.      */
  54.     private function initialize(event:Event):void
  55.     {
  56.         stage.removeEventListener( Event.ENTER_FRAME, initialize );
  57.         trace( "BlowFish::initialize()" );
  58.     }
  59.    
  60. }
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement