Flicks FAQ: Encodeviadll


Back to the top of the FAQ

EncodeViaDLL

The EncodeViaDLL method calls the dll which you have supplied to encrypt/encode passwords in the external ODBC database. Use this method via ASP pages to encode a password before entering it into your own ODBC database password field. You do not need this if you are entering a password into the internal database.

Syntax

EncodeViaDLL(compliantDLLPath, stringToEncode, encodedString)

Parameters

compliantDLLPath
The full pathname of the compliant dll.
stringToEncode
The password you wish to translate.
encodedString
The resulting encoded string

Return Values

Returns 0 for success. -11 if the encoded string is not of string type (set it to ""). -199 if the library could not be found (check the application event log). -198 if the translation function AXEncrypt could not be found in the dll. -197,-196 if there was a problem encrypting the string.

Notes

If you decide that you want to encode/encrypt passwords in your ODBC database, then you need to supply a dll for AuthentiX to encode/encrypt the password the user supplies, then to compare it with the encoded/encrypted password value in the database. You turn this on in the Options/Passwords "Encrypt passwords and compare against ODBC" checkbox.

If you then wanted to add users to the ODBC database via ASP, then this dll has to be called via an OCX method, and EncodeViaDLL is there to help you do this.

There is no need to decode this string, in fact if you encrypted it you would never be able to. From ASP you can get the username the user types in using CurrentUserName You can get the password the user types in using Base64Password as noted in the docs for currentusername

There is a base64 dll supplied which you can use, or you can create your own dll if your encryption needs are stronger.

Example

The following encodes a password with the supplied base64 module.


<% 
usingAuthentiXStandard = true
usingAuthentiXStandard = true
if (usingAuthentiXStandard) then
Set AuthX = Server.CreateObject("AUTHXOCX.AuthXOCXCtrl.1") 
else
Set AuthX = Server.CreateObject("AUTHXISP.AuthXOCXCtrl.1") 
protectedDomain = Request.ServerVariables("LOCAL_ADDR")
'protectedDomain = "hostheader.com"
AuthX.SetVirtualDomain protectedDomain, Request.ServerVariables("SCRIPT_NAME")
AuthX.SetVirtualDomainPassword("")
end if


encodedPassword = ""
result = AuthX.EncodeViaDLL("c:\flicks\authentix\base64.dll", "passwordNumber1", encodedPassword)

if 0 = result Then
%>
<h2>
Encoded password is <%= encodedPassword %>
</h2>
<% Else %>
<h2>
Error: <%= result %>
</h2>
<% End If %>


 

Applies To

AuthentiX OCX Component

http://www.flicks.com/authentix/discover/main.htm

Back to the top of the FAQ