Add to Favorites    Make Home Page 8748 Online  
 Language Categories  
 Our Services  

Home » ASP Home » Math Home » RC4 Class

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title RC4 Class
Description Applys Encryption/Decryption to strings. This version is more cleaned up and thrown into a nice little class for an object oriented feeling. It is also a little more optimized to run quicker if you change the Key/Password often.
Category ASP » Math
Hits 378896
Code Select and Copy the Code
<% Option Explicit Dim ObjRC4 Set ObjRC4 = New clsRC4 ObjRC4.Key = "Joe" Response.Write """" & ObjRC4.Crypt("hello") & """" Set ObjRC4 = Nothing ' -------------------------------------- ' ---------------------------------------- ' Class clsRC4 Private mStrKey Private mBytKeyAry(255) Private mBytCypherAry(255) Private Sub InitializeCypher() Dim lBytJump Dim lBytIndex Dim lBytTemp For lBytIndex = 0 To 255 mBytCypherAry(lBytIndex) = lBytIndex Next ' Switch values of Cypher arround based off of index and Key value lBytJump = 0 For lBytIndex = 0 To 255 ' Figure index To switch lBytJump = (lBytJump + mBytCypherAry(lBytIndex) + mBytKeyAry(lBytIndex)) Mod 256 ' Do the switch lBytTemp = mBytCypherAry(lBytIndex) mBytCypherAry(lBytIndex) = mBytCypherAry(lBytJump) mBytCypherAry(lBytJump) = lBytTemp Next End Sub Public Property Let Key(ByRef pStrKey) Dim lLngKeyLength Dim lLngIndex If pStrKey = mStrKey Then Exit Property lLngKeyLength = Len(pStrKey) If lLngKeyLength = 0 Then Exit Property mStrKey = pStrKey lLngKeyLength = Len(pStrKey) For lLngIndex = 0 To 255 mBytKeyAry(lLngIndex) = Asc(Mid(pStrKey, ((lLngIndex) Mod (lLngKeyLength)) + 1, 1)) Next End Property Public Property Get Key() Key = mStrKey End Property Public Function Crypt(ByRef pStrMessage) Dim lBytIndex Dim lBytJump Dim lBytTemp Dim lBytY Dim lLngT Dim lLngX ' Validate data If Len(mStrKey) = 0 Then Exit Function If Len(pStrMessage) = 0 Then Exit Function Call InitializeCypher() lBytIndex = 0 lBytJump = 0 For lLngX = 1 To Len(pStrMessage) lBytIndex = (lBytIndex + 1) Mod 256 ' wrap index lBytJump = (lBytJump + mBytCypherAry(lBytIndex)) Mod 256 ' wrap J+S() ' Add/Wrap those two lLngT = (mBytCypherAry(lBytIndex) + mBytCypherAry(lBytJump)) Mod 256 ' Switcheroo lBytTemp = mBytCypherAry(lBytIndex) mBytCypherAry(lBytIndex) = mBytCypherAry(lBytJump) mBytCypherAry(lBytJump) = lBytTemp lBytY = mBytCypherAry(lLngT) ' Character Encryption ... Crypt = Crypt & Chr(Asc(Mid(pStrMessage, lLngX, 1)) Xor lBytY) Next End Function End Class %>

Related Source Codes

Script Name Author
��������������������� VyomWorld
Resistor color code reader A.Chermarajan.
Telephone Directory dhivya
card swapping game (Mini Project) nityanand
simple hangman-pascalsource Seabert
college dirtectory (Mini Project) msridhar
Poll Application John van Meter
ASP Daily Hit Counter. Tejaskumar Gandhi
To avoid null in asp environment using sql Sami
Maklumbalas webmaster
poll John van Meter
EasyASP Template Engine. TjoekBezoer
Basic Calculator using HTML & Javascript. Patrick M. D Souza
What servers support ASP ? VyomWorld
What is ASP? VyomWorld

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=289


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review