Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Imaging Lingo - Hyporoid Illusion
Roil Button-Alphamania
Buddy Zip/Unzip
Elliptical Sprite Behavior
Magic Button
Select From DropDown List
Toggle ImageEnabled Property of a Flash Sprite
Sound Slidebar
Returns Rect of visible PDF doc within an Impressario sprite
Blur Rollover-Alphamania
MediaMacros Xtras Mall
 

 

 

Behavior RC4 Encryption Algorithm Script

Added on 4/9/2002

 

Compatibilities:
D7 D8 D8_5 Script Shockwave UK

Rating:

Author: psychicparrot (website)

RC4 is a stream cipher. Using a password, a string may be encrypted. By running the encrypted text through the same algorithm, the string becomes readable only when the password is the same as the one used during encryption. Great for protecting your high score tables or prefs files from prying eyes and itchy hacker fingers! ;) PsychicParrot.

Download PC Source
-- RC4 Algorithm
--
-- Adapted from VB code written by Luke Bailey
-- Copyright 2002 PsychicParrot
-- oracle@psychicparrot.com
--
-- You are welcome to use this script as you wish, but keep these comments intact please!
--

global sbox,ke,scn,srn,tempswap,a,b
global temp,i,j,k,cipherkey,cipher

on beginsprite
  
  sbox=[]
  ke=[]
  
end

on Security_RC4Initialise(strpwd)
  
  cipher=EMPTY
  intlength = strpwd.length
  sbox=[]
  ke=[]
  
  repeat with a=1 to 255
    
    ke[a]=chartonum(strpwd.char[(a mod intlength+1)..(a mod intlength+1)])
    sbox[a]=a
    
  end repeat
  
  b=0
  
  repeat with a=1 to 255
    b=((b+sbox[a]+ke[a]) mod 255)
    tempswap = sbox[a]
    sbox[a]=sbox[b]
    sbox[b]=tempswap
  end repeat
  
end

on Security_RC4(plaintxt)
  
  i=0
  j=0
  
  repeat with a=1 to plaintxt.length
    
    i=((i+1) mod 255)
    j=((j+sbox[i]) mod 255)
    temp=sbox[i]
    sbox[i]=sbox[j]
    sbox[j]=temp
    k=sbox[((sbox[i]+sbox[j]) mod 255)]
    cipherby=bitXor(chartonum(plaintxt.char[a..a]),k)
    cipher=cipher&numtochar(cipherby)
    
  end repeat
  
  RETURN cipher
  
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail