Archive for February, 2009

PLS-00103: Encountered the symbol "" WHEN expecting one OF the following

Tuesday, February 17th, 2009

I recently came across this error whilst developing stored procedures in oracle. The stored procedure will be built in Oracle but marked as invalid. Trying a re-compile will give you the above error.

The problem appears to be with Windows CRLF characters on line breaks. Oracle does not treat this as white space, instead it sees it as an empty string. In order to get round this problem, convert the CRLF characters to LF characters and Oracle should be happy.

Using VB.Net To Encrypt LDAP MD5 Passwords

Wednesday, February 11th, 2009

When passwords are stored in an LDAP directory they are stored encrypted. LDAP supports different types of hashing, but I chose to use MD5.  The LDAP implementation is to use Base 64 encoding. Below is a simple function I use to convert the plain text password into a hashed string ready to be added to LDAP.

Public Shared Function EncryptPassword(ByVal value As String) As String

        Dim cryptProvider As New MD5CryptoServiceProvider
        Dim b As Byte() = Text.UTF8Encoding.UTF8.GetBytes(value)
        Dim encoded As Byte() = cryptProvider.ComputeHash(b)
        Dim hash As String = Convert.ToBase64String(encoded)

        Return hash

End Function

foreandaft