Question

RSA implementation in VB

Asked by: nuesiri

I know the points are too small for the job..
I'll let U in on a secret. I know the location of the magical head of wisdom (king solomon the 1st)

Seriously.. I need a VB implementation of RC4 Stream Cipher or DES or Blowfish.

I know how to get the libraries to work.. but I want to implement it in VB classes.

Please can anyone help.?

I will also award full points for helpful answers that can get me started.?

thanks

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2000-09-20 at 07:34:51ID11327620
Tags

vb

Topic

Visual Basic Programming

Participating Experts
2
Points
100
Comments
6

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. How To Implement RSA ?
    How can I Implement RSA Encryption in Delphi ? or can i get the full algorithm of RSA ?
  2. RSA cipher, response time, File system ...
    hi everyone, i have some OS related questions and would like to get some help: 1. Suppose that you have a UNIX file system where the disk block size is 1kB, and an i-node takes 64 bytes. Disk addresses take 32 bits, and the i-node contains 8 direct addresses, one indirect, ...
  3. Cipher
    i was trying to use this code http://www.exampledepot.com/egs/javax.crypto/DesString.html what is the class "Cipher" and "SecretKey". are they provided by java? In this line Cipher.getInstance("DES"); , what is DES? I dont seem to find the...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: PaulHewsPosted on 2000-09-20 at 08:43:09ID: 4374313

Here is a Blowfish implementation.  Please note:

1.  Not compiled as a separate DLL, but is a class that you can include in your project.  Doesn't require turning off overflow checking like the TwoFish implementation.

2.  Basically works on byte arrays, but it has wrapper functions for Text (shown in test code.)

3.  I will not assume any liablility for loss of data or any other damages arising from use of this code.  It is essentially a step for step translation of the original BF algorithm, and I have tested it on many different data sources without problem.  If there are any bugs, a) they would be quite subtle  b) I am not aware of them.

4.  The bf.dat file contains the initialization data for the p and s boxes.  You have a couple of choices.

a) You can load these arrays with random data. (Make sure you are using the full range of the Long data type if you do this.)  if you test the routine against the test vectors provided at Counterpane, you will not get the same results.  However, your data should be as secure.

b)  I can e-mail you the file.

c)  You can recreate the file from the source at www.counterpane.com (what I did originally, although I don't have the source for that anymore :( )

Any questions comments etc. you can post here.  Test code follows the code for clsBlowfish.




Option Explicit

'Long(long integer)  4 bytes -2,147,483,648 to 2,147,483,647

Private Const MaxLong = 2147483647
Private Const MinLong = -2147483648#

Private mbIsInit As Boolean
Private Const strErrSrc = "clsBlowfish"

Private P(1 To 18) As Long
Private S(1 To 4, 0 To 255) As Long

'Types for extracting bytes from words
Private Type LongByteW
    w As Long
End Type

Private Const BFErr = 3400 + vbObjectError

Private Type LongByteB
    b4 As Byte
    b3 As Byte
    b2 As Byte
    b1 As Byte
End Type

Private Function fAddBytes(b1 As Byte, b2 As Byte) As Byte
    fAddBytes = CByte((CInt(b1) + CInt(b2)) Mod 256)
End Function

Private Function fAddLongs(L1 As Long, L2 As Long) As Long
    Dim curRes As Currency, c1 As Currency, c2 As Currency
    Static intCount As Integer
     
    'This function allows you to add the longs without turning off the
    'integer overflow checking.  Thus it is slower, but works in the IDE
    'and with any project you wish to add this code to.
     
    c1 = L1
    c2 = L2
     
    curRes = c1 + c2
     
    If curRes > MaxLong Then
        curRes = curRes - MaxLong + MinLong - 1
    End If
     
    If curRes < MinLong Then
        curRes = curRes + MaxLong - MinLong + 1
    End If
     
    fAddLongs = CLng(curRes)
         
End Function

Public Sub sInitBF(strKey As String)
    Dim i As Integer
    Dim j As Integer
    Dim x As LongByteW      'For conversion
    Dim y As LongByteB      ' """"
    Dim intKeyLen As Integer
    Dim bytKey() As Byte
    Dim lngDataL As Long, lngDataR As Long
     
    intKeyLen = Len(strKey)
    ReDim bytKey(0 To intKeyLen - 1)
     
    Call sStringToByte(strKey, bytKey)
     

    Call sSetPSBox
     
     
    j = 0
    For i = 1 To 18
        y.b1 = bytKey(j)
        y.b2 = bytKey((j + 1) Mod intKeyLen)
        y.b3 = bytKey((j + 2) Mod intKeyLen)
        y.b4 = bytKey((j + 3) Mod intKeyLen)
        LSet x = y
        P(i) = P(i) Xor x.w
        j = (j + 4) Mod intKeyLen
    Next
     
    lngDataL = 0: lngDataR = 0

    For i = 1 To 17 Step 2
        Call BFEncipher(lngDataL, lngDataR)
        P(i) = lngDataL
        P(i + 1) = lngDataR
    Next
     
    For i = 1 To 4
        For j = 0 To 254 Step 2
            Call BFEncipher(lngDataL, lngDataR)
            S(i, j) = lngDataL
            S(i, j + 1) = lngDataR
        Next j
    Next i
     
    mbIsInit = True
     
End Sub

Private Function F(Word As Long) As Long
    Dim x As LongByteW
    Dim y As LongByteB

    x.w = Word
     
    LSet y = x
    'Debug.Print S(1, Y.b1), S(2, Y.b2)
    F = fAddLongs(fAddLongs(S(1, y.b1), S(2, y.b2)) Xor (S(3, y.b3)), S(4, y.b4))
     

End Function

Private Sub Round(xL As Long, xR As Long, intRound As Integer)
    'Debug.Print F(xR), xR
    xL = xL Xor (F(xR) Xor P(intRound))
End Sub

Private Sub BFEncipher(xL As Long, xR As Long)
    Dim lngTemp As Long
    Dim i As Integer
    xL = xL Xor P(1)
    'Call sFilePrintSP
    For i = 2 To 16 Step 2
        Call Round(xR, xL, i)
        Call Round(xL, xR, i + 1)
    Next
     
    xR = xR Xor P(18)
     
    'Swap left and right
    lngTemp = xR
    xR = xL
    xL = lngTemp


End Sub


Private Sub BFDecipher(xL As Long, xR As Long)
    Dim lngTemp As Long
    Dim i As Integer
     
    xL = xL Xor P(18)
     
    For i = 17 To 3 Step -2
        Call Round(xR, xL, i)
        Call Round(xL, xR, i - 1)
    Next
     
    xR = xR Xor P(1)
     
    'Swap left and right
    lngTemp = xR
    xR = xL
    xL = lngTemp


End Sub





Private Sub sFilePrintSP()
'For debugging only.
     
    Dim i As Integer
     
    Open "C:\Windows\Desktop\SPWin.txt" For Output As #1
     
    Print #1, ""
    Print #1, "PBox"
    Print #1, ""
    For i = 1 To 15 Step 6
        Print #1, P(i), P(i + 1), P(i + 2), P(i + 3), P(i + 4), P(i + 5)
    Next
    Print #1, ""
    Print #1, "SBox"
    Print #1, ""
    For i = 0 To 252 Step 4
        Print #1, S(1, i), S(1, i + 1), S(1, i + 2), S(1, i + 3)
    Next
    Close #1



End Sub

Public Sub sEncrypt(bytToEncrypt() As Byte, bytEncrypted() As Byte)

'This Sub assumes you are passing a 64 bit divisible zero-based array of bytes to
'encode and a similarly sized array to hold the encrypted version.
'Todo:  Add error checking for these conditions

    Dim lngLenStr As Long
    Dim lngLenBStr As Long
    Dim xL As LongByteB, xR  As LongByteB
    Dim yL As LongByteW, yR  As LongByteW
    Dim i As Long
    Dim strRet As String
    Dim bytB As Byte
     
    'Check zero based
    bytB = bytToEncrypt(0)
    bytB = bytEncrypted(0)
     
     
    If UBound(bytToEncrypt) <> UBound(bytEncrypted) Then
        Err.Raise BFErr + 2, strErrSrc, "Need to pass two byte arrays the same size"
        Exit Sub
    End If
     
    If (UBound(bytToEncrypt) + 1) Mod 8 <> 0 Then
        Err.Raise BFErr + 3, strErrSrc, "Byte array must be sized divisible by 8."
        Exit Sub
    End If
     
    If Not mbIsInit Then
        Err.Raise BFErr + 1, strErrSrc, "Call sInitBF before calling this sub"
        Exit Sub
    End If
     
    lngLenBStr = UBound(bytToEncrypt) + 1
     
    For i = 0 To lngLenBStr - 8 Step 8
        xL.b1 = bytToEncrypt(i)
        xL.b2 = bytToEncrypt(i + 1)
        xL.b3 = bytToEncrypt(i + 2)
        xL.b4 = bytToEncrypt(i + 3)
         
        xR.b1 = bytToEncrypt(i + 4)
        xR.b2 = bytToEncrypt(i + 5)
        xR.b3 = bytToEncrypt(i + 6)
        xR.b4 = bytToEncrypt(i + 7)
         
        LSet yR = xR
        LSet yL = xL
         
'        Debug.Print Hex(yL.w), Hex(yR.w)
         
        Call BFEncipher(yL.w, yR.w)
         
'        Debug.Print Hex(yL.w), Hex(yR.w)
         
        LSet xR = yR
        LSet xL = yL
         
        bytEncrypted(i) = xL.b1
        bytEncrypted(i + 1) = xL.b2
        bytEncrypted(i + 2) = xL.b3
        bytEncrypted(i + 3) = xL.b4
         
        bytEncrypted(i + 4) = xR.b1
        bytEncrypted(i + 5) = xR.b2
        bytEncrypted(i + 6) = xR.b3
        bytEncrypted(i + 7) = xR.b4
         
         
    Next i
     

End Sub


Public Sub sDecrypt(bytToDecrypt() As Byte, bytUnencrypted() As Byte)

'This Sub assumes you are passing a 64 bit divisible zero-based array of bytes to
'encode and a similarly sized array to hold the encrypted version.
'Todo:  Add error checking for these conditions

'    Dim bytToDecrypt() As Byte
    Dim lngLenStr As Long
    Dim lngLenBStr As Long
    Dim xL As LongByteB, xR  As LongByteB
    Dim yL As LongByteW, yR  As LongByteW
    Dim i As Long
    Dim strRet As String
     
   lngLenStr = UBound(bytToDecrypt) + 1
    lngLenBStr = lngLenStr
     
    If UBound(bytToDecrypt) <> UBound(bytUnencrypted) Then
        Err.Raise BFErr + 2, strErrSrc, "Need to pass two byte arrays the same size"
        Exit Sub
    End If
     
    If (UBound(bytToDecrypt) + 1) Mod 8 <> 0 Then
        Err.Raise BFErr + 3, strErrSrc, "Byte array must be sized divisible by 8."
        Exit Sub
    End If
     
    If Not mbIsInit Then
        Err.Raise BFErr + 1, strErrSrc, "Call sInitBF before calling this sub"
        Exit Sub
    End If

     
    For i = 0 To lngLenBStr - 8 Step 8
        xL.b1 = bytToDecrypt(i)
        xL.b2 = bytToDecrypt(i + 1)
        xL.b3 = bytToDecrypt(i + 2)
        xL.b4 = bytToDecrypt(i + 3)
         
        xR.b1 = bytToDecrypt(i + 4)
        xR.b2 = bytToDecrypt(i + 5)
        xR.b3 = bytToDecrypt(i + 6)
        xR.b4 = bytToDecrypt(i + 7)
         
        LSet yR = xR
        LSet yL = xL
         
'        Debug.Print Hex(yL.w), Hex(yR.w)
         
        Call BFDecipher(yL.w, yR.w)
         
'        Debug.Print Hex(yL.w), Hex(yR.w)
         
        LSet xR = yR
        LSet xL = yL
         
        bytUnencrypted(i) = xL.b1
        bytUnencrypted(i + 1) = xL.b2
        bytUnencrypted(i + 2) = xL.b3
        bytUnencrypted(i + 3) = xL.b4
         
        bytUnencrypted(i + 4) = xR.b1
        bytUnencrypted(i + 5) = xR.b2
        bytUnencrypted(i + 6) = xR.b3
        bytUnencrypted(i + 7) = xR.b4
         
         
    Next i


End Sub


Private Function fTrimZeroBytes(S As String) As String

    Dim i As Long
    Dim lngLen As Long
    Dim lngPos As Long
     
    lngLen = Len(S)
     
    For i = lngLen To 1 Step -1
        If Asc(Mid$(S, i, 1)) <> 0 Then
            lngPos = i
            Exit For
        End If
    Next i
     
    fTrimZeroBytes = Left$(S, lngPos)
     
End Function



Private Sub sSetPSBox()

    Dim strPath As String
    Dim hFile As Integer
     
    strPath = App.Path
     
    If Right$(strPath, 1) <> "\" Then
        strPath = strPath & "\"
    End If
'    Debug.Print strPath
    If Len(Dir(strPath & "bf.dat")) = 0 Then
        Err.Raise BFErr + 3, , "bf.dat not found"
        Exit Sub
    End If
     
    hFile = FreeFile
    Open strPath & "bf.dat" For Binary As hFile
    Get #hFile, , P
    Get #hFile, , S
    Close #hFile
     
End Sub

Public Sub sFileEncrypt(strFileSrc As String, strFileTrg As String)
     
     
    Dim lngLen As Long
    Dim lngLenB As Long
    Dim strFile As String
    Dim strEnc As String
    Dim bytSource() As Byte
    Dim bytTarget() As Byte
    Dim strUnEnc As String
    Dim sngTimer As Single
    Dim hFile As Integer
     
    If Not mbIsInit Then
        Err.Raise BFErr + 1, , "Call sInitBF before calling this sub"
        Exit Sub
    End If
     
    If Len(Dir(strFileSrc)) = 0 Then
        Err.Raise BFErr + 2, , "Source file is not found"
        Exit Sub
    End If
     
    sngTimer = Timer
     
    lngLen = FileLen(strFileSrc)
    ReDim bytSource(0 To lngLen - 1)
     
    hFile = FreeFile
    Open strFileSrc For Binary As #hFile
    Get #hFile, , bytSource
    Close #hFile
     
    'Need to pad the string with zeroes if not divisible by 64 bits
    If lngLen Mod 8 <> 0 Then
        lngLenB = lngLen + (8 - lngLen Mod 8)
    Else
        lngLenB = lngLen
    End If
     
'    Debug.Print lngLenB
     
    ReDim Preserve bytSource(0 To lngLenB - 1)
    ReDim bytTarget(0 To lngLenB - 1)
     
     
    Call sEncrypt(bytSource, bytTarget)
     
    If Len(Dir(strFileTrg)) <> 0 Then
        Kill strFileTrg
    End If
     
     
     
    hFile = FreeFile
    Open strFileTrg For Binary As #hFile
    'Save the original file length so that we know how much padding to remove.
    Put #hFile, , lngLen
    Put #hFile, , bytTarget
    Close #hFile
     
    Debug.Print Timer - sngTimer


End Sub

Public Sub sFileDecrypt(strFileSrc As String, strFileTrg As String)
     
     
    Dim lngLen As Long
    Dim lngLenB As Long
    Dim strFile As String
    Dim strEnc As String
    Dim bytSource() As Byte
    Dim bytTarget() As Byte
    Dim strUnEnc As String
    Dim sngTimer As Single
    Dim hFile As Integer
     
    If Not mbIsInit Then
        Err.Raise BFErr + 1, , "Call sInitBF before calling this sub"
        Exit Sub
    End If
     
    If Len(Dir(strFileSrc)) = 0 Then
        Err.Raise BFErr + 2, , "Source file is not found"
        Exit Sub
    End If

    sngTimer = Timer
     
     
    lngLenB = FileLen(strFileSrc) - 4
     
'    Debug.Print lngLenB
     
    ReDim bytSource(0 To lngLenB - 1)
    ReDim bytTarget(0 To lngLenB - 1)
     
     
    hFile = FreeFile
    Open strFileSrc For Binary As #hFile
    Get #hFile, , lngLen
    Get #hFile, , bytSource
    Close #hFile
     
   
     
    Call sDecrypt(bytSource, bytTarget)
     
    ReDim Preserve bytTarget(0 To lngLen - 1)
     
    If Len(Dir(strFileTrg)) <> 0 Then
        Kill strFileTrg
    End If
     
    hFile = FreeFile
    Open strFileTrg For Binary As #hFile
    Put #hFile, , bytTarget
    Close #hFile
     
    Debug.Print Timer - sngTimer

End Sub

Private Sub sStringToByte(strS As String, bytB() As Byte)

'    Dim i As Integer
'
'    For i = 1 To Len(strS)
'        bytB(i - 1) = CByte(Asc(Mid$(strS, i, 1)))
'    Next

bytB = StrConv(strS, vbFromUnicode)

End Sub

Public Sub sStringEncrypt(strToEncrypt As String, strEncrypted As String)
    Dim bytToEncrypt() As Byte
    Dim bytEncrypted() As Byte
    Dim lngLenStr As Long
    Dim lngLenBStr As Long
    Dim xL As LongByteB, xR  As LongByteB
    Dim yL As LongByteW, yR  As LongByteW
    Dim i As Long
    Dim strRet As String
     
    lngLenStr = Len(strToEncrypt)
     
     
    'Need to pad the string with zeroes if not divisible by 64 bits
    If lngLenStr Mod 8 <> 0 Then
        lngLenBStr = lngLenStr + (8 - lngLenStr Mod 8)
    Else
        lngLenBStr = lngLenStr
    End If
     
     
'    ReDim bytToEncrypt(0 To lngLenBStr - 1)
     
    Call sStringToByte(strToEncrypt, bytToEncrypt)
    ReDim Preserve bytToEncrypt(0 To lngLenBStr - 1)
    ReDim bytEncrypted(0 To lngLenBStr - 1)
     
    Call sEncrypt(bytToEncrypt, bytEncrypted)
     
    strEncrypted = StrConv(bytEncrypted, vbUnicode)



End Sub


Public Sub sStringDecrypt(strToDecrypt As String, strUnencrypted As String)
     Dim bytToDecrypt() As Byte
    Dim bytDecrypted() As Byte
    Dim lngLenStr As Long
    Dim lngLenBStr As Long
    Dim xL As LongByteB, xR  As LongByteB
    Dim yL As LongByteW, yR  As LongByteW
    Dim i As Long
    Dim strRet As String
     
    lngLenStr = Len(strToDecrypt)
    'Should be divisible by 8
    'TODO:
    'Error checking on 64 bit boundary
     
    If lngLenStr Mod 8 <> 0 Then
        Err.Raise BFErr + 3, , "String to decrypt should be sized divisible by 8."
        Exit Sub
     
    End If
 
    Call sStringToByte(strToDecrypt, bytToDecrypt)
    ReDim bytDecrypted(0 To UBound(bytToDecrypt))
     
    Call sDecrypt(bytToDecrypt, bytDecrypted)
     
    strUnencrypted = StrConv(bytDecrypted, vbUnicode)
    i = InStr(1, strUnencrypted, Chr(0))
    If i > 1 Then
        strUnencrypted = Left$(strUnencrypted, i - 1)
    End If
     



End Sub



'-----Test code

Private Sub Command5_Click()
    Dim Enc As clsBlowfish
    Dim strEnc As String
    Dim strPlain As String
     

    Set Enc = New clsBlowfish

    Call Enc.sInitBF("abcdefghijklmnopqrstuvwxyz")
    Call Enc.sStringEncrypt("BLOWFISHHowdiedoodie was a sailor.....     ", strEnc)
    Debug.Print strEnc
     
    Call Enc.sStringDecrypt(strEnc, strPlain)
    Debug.Print strPlain
'    call enc.sStringDecrypt(
     
'    Debug.Print Enc.fDecrypt(strEnc)


End Sub

 

by: nuesiriPosted on 2000-09-20 at 15:58:13ID: 4379873

Please email file to dnuesiri@yahoo.com

 

by: nuesiriPosted on 2000-09-20 at 16:36:41ID: 4380253

Thanks.

 

by: PaulHewsPosted on 2000-09-20 at 17:21:28ID: 4380657

Let's see...

>I know the points are too small for the job..

But you can't afford to give me an 'A'?  How come?

I made the choice to post my code despite the amount of points offered.  I could have kept it to myself.

Since I see you have given out 2 B's and only 1 A, here are some grading tips from Community Support:


From Community Support:
---------------------------------------
Grading tips...

Tip One: Always give an 'A' grade unless you have a clear reason not to do so.

Tip Two: Before giving less than an 'A' grade, tell the Experts that the solution is less than excellent and what grade you are prepared to assign. Give them the chance to improve their response for a better grade.

Tip Three: Always post a comment when accepting a grade. Update the Experts and let them know that the solution worked and why it worked.

Tip Four: Give your time to the Experts. Experts Exchange is a completely free site for you. The only thing we ask of you is a small amount of your time when you are managing your questions. In exchange for your time you get some of the very best help available in the world. It really requires very little time to post a comment but the pay off is well worth it when the Experts feel appreciated - see Tip One.

Tip Five: Always post a response to every post that each Expert makes. This keeps the Experts informed of your progress and the current state of the problem. You will never regret keeping the Experts informed on the status of your problem that they are trying to fix.

That is it. If you will follow those five tips, you will get the most out of Experts Exchange - The Best Site On The Internet!

darinw
Community Support

 

by: mdouganPosted on 2000-09-21 at 14:08:55ID: 4394982

Here are a few links that I've found on the topic:

http://www.isuisse.com/visualbasic/pagel.htm
http://www.baltimore.com/news/archive/pr970818.html
http://www.sevillaonline.com/ActiveX/vb5/ARCryptoLib.htm

You can also check out some code that Waty (one of the experts here) has posted on :

http://www.vbdiamond.com/

Look for Encryption Samples

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...