DecodeBase64 - Parameters are nopt compatible with this function

Hi all,

I’m attempting encoding and decoding of encrypted text but coming across issues with the decoding as the it can’t recognize the argument i’m passing to the simple decoding function.

Here’s what happens in my window open event handler:

[code] dim blow as new BlowfishMBS

dim blow as new BlowfishMBS

blow.SetKey(“PaSsw0rd3nCrypT”)

dim temp as MemoryBlock

dim d as string = str(blow.encryptcfb64(“User1Password”,temp))

dim encodedtext as String = encodePassword(d)

dim decodedText as String = decodePassword(encodedtext)

Break
[/code]

Here’s my encoding bit which is in the function encodePassword:

Function encodePassword(encryptedstring As String) As String
  dim encodedText As String
  
  encodedText = EncodeBase64(encryptedstring, 0)
  
  Return encodedText
End Function

Here’s my decoding bit which is in the function decodePassword and I’m getting the error when the program passes encodedText to DecodeBase64():

Function decodePassword(encodedText As String) As String
  dim decodedText as String
  
  decodedText = DecodeBase64(encodedText, 0)
  
  Return decodedText
End Function

Any ideas as I feel I’m missing something basic but can’t seem to work out what it is

thanks

DecodeBase64 has an optional second parameter, but it’s a TextEncoding, not an Integer. Remove the “0” and it should work fine.