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
Download BlowfishASP.zip (20 kB) last updated 2009-05-06.
Converting VB6 to VBScript
Here are some hints for converting your Visual Basic (VB6/VBA) code into VBScript:- 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
Asc$()
orMid$()
, remove the trailing "$". Hint: globally replace "Asc$(" with "Asc(".
- In your For loops, remove anything after the
Next
keyword, e.g. If you typically write your loops asFor i = 1 To 10 ' ... Next i
remove 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.
See also
Back to the Cryptography Page.
Contact us
To comment on this page or to contact us, please send us a message.
This page last updated 9 September 2025.