Blowfish in ASP
This is a conversion of David Ireland's Blowfish Visual Basic code into VBScript and a sample demo ASP page by Hart Penn.
Download BlowfishASP.zip (20 kB) last updated 2009-05-06.
- Surround your code with <% and %>
- Remove all type names from dimension statements, i.e. globally delete
As String", "
As Integer", "
As Long", etc.
- Remove any specific sizes for strings, e.g. remove the "* 8" from
Dim strBlock As String * 8.
- If you've used the faster string functions that end in $ such as
Mid$(), remove the trailing "$". Hint: globally replace "Asc$(" with "Asc(".
- In your For loops, remove anything after the
Nextkeyword, e.g. If you typically write your loops as
For i = 1 To 10 ' ... Next iremove the "i" after the Next.
- Replace any functions that are not valid in VBScript. In the Blowfish example,
we had to replace the very useful
StrConv(). For a list of valid functions in VBScript see the Microsoft VBScript Features page, and also VBScript Features not in Visual Basic for Applications.
- Remove the keyword Private from constant definitions, as in
Private Const scNAME
This is not meant to be an exhaustive list, but we hope a helpful one.
Back to the Cryptography Page.
This page last updated 5 June 2009