Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DES encryption via Lotusscript or Java  web Agent

Posted on 2002-05-19
14
Medium Priority
?
1,208 Views
Last Modified: 2013-12-18
The problem:
A Web agent needs to DES encode 2 variables obtained from lotus db and and append them to a URL.
Eg. my site www.example.com
somebody logs in, i get certain info from the lotus db based on their login info (REMOTE_USER)(can do this part)and want to present a link to the user that has those two values DES encoded.

Eg:
http://www.somewhereelse.com?value1=[encryptedValue1]&value2=[encryptedvalue2]

The other site will then decode the values and use them appropriately.

Does anyone know or preferably have code that is domino compatible? The Agent can be written in either Lotusscript or Java. All i need is the code that encrypts a variable using DES, i can do the rest.
Sun has a Java library to do this but i'm not sure how to make this work on an agent.
Lots of points on offer, will award BONUS points if a whole AGENT that does this is provided. BONUS points dependant on how much work the Agent saves me.
0
Comment
Question by:HRT_HSV
  • 7
  • 5
  • 2
14 Comments
 
LVL 10

Accepted Solution

by:
zvonko earned 1050 total points
ID: 7021507
OK, I catch your word "All i need is the code that encrypts a variable using DES, i can do the rest."

Here it goes.

Doing it in Java is multy complicated because you have several layers (service providers) and version dependencies (Domino agents base on 1.1.8) so it get to difficult.
Much easier it is on LotusScript side but only for OLE/COM platforms (Windows :-) There you can use Microsoft CAPICOM distribution.
Download and register first this CAPICOM.dll form here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/Security/getting_ready_to_use_capicom.asp
http://www.microsoft.com/downloads/release.asp?releaseid=30316

Please not that CCRINST.exe is a cabinet containing CAPICOM.dll
I have moved mine to: C:\WINDOWS\system32\CAPICOM.dll
And registered with:
regsvr32 C:\WINDOWS\system32\CAPICOM.dll

When you have registered this then is encoding with DES done like this:
Const CAPICOM_ENCRYPTION_ALGORITHM_RC2 = 0
Const CAPICOM_ENCRYPTION_ALGORITHM_RC4 = 1
Const CAPICOM_ENCRYPTION_ALGORITHM_DES = 2
Const CAPICOM_ENCRYPTION_ALGORITHM_3DES  = 3

Const CAPICOM_ENCODE_BASE64 = 0
Const CAPICOM_ENCODE_BINARY = 1

Const CAPICOM_SECRET_PASSWORD = 0

Sub Initialize
  Dim crypto As String
 
  Msgbox "Test"
  crypto = EncryptMessage("Test", "topsecret")
  Msgbox ">: " & crypto
End Sub
Function EncryptMessage(Byval TobeEncrypted As String, Byval hidden As String) As String
  Dim message As Variant
  On Error Goto errorhandler  
' Declare and initialize an EncryptedData object.
  Set message = CreateObject( "CAPICOM.EncryptedData" )
  Call message.SetSecret(hidden, CAPICOM_SECRET_PASSWORD)
  message.Algorithm.Name = CAPICOM_ENCRYPTION_ALGORITHM_DES
  message.Content = Tobeencrypted
'Declare the string that will hold the encrypted message.
  Dim encryptedmessage As String
'Encrypt the message storing the result in the encryptedmessage string
  encryptedmessage = message.Encrypt(CAPICOM_ENCODE_BASE64)
' Optionally, check the length of the encrypted string to make sure that the
' encrypt method worked.
  If Len(encryptedmessage) < 1 Then
    Msgbox "no message encrypted. "
  Else
    Msgbox " Message is " & Len(encryptedmessage) & " characters"
    EncryptMessage = encryptedmessage
  End If
' Release the EncryptedData object.
  Set message = Nothing
  Exit Function
ErrorHandler:
  If Err > 0 Then
    Msgbox "Error in Line: " & Erl & "; Msg: " & Error
  Else
    Msgbox "CAPICOM error found : " & Err
  End If
  Exit Function
End Function


Any questions?

PS: my upper code is derived from Microsoft CAPICOM example found in upper URLs and tested by me to encrypt (and decrypt :-) correctly.

0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7022239
Guess you will get to the 100k Mark before me for sure at this rate Zvo !

;-)
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7022767
I hope so :-)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 9

Expert Comment

by:Arunkumar
ID: 7022908
Well...Good Luck!
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7025487
Hello HRT_HSV,

any progress with this?
Do you need more details?


0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7025659
Did you see the game by Moon and JM ???
0
 

Author Comment

by:HRT_HSV
ID: 7025766
Ok thank you for the response.
I will give that a try asap and award you the points if it works.

I am willing to award more points if anyone can provide a non-windows solution also. The windows solution is sufficient for now but solution may need to be ported to a different platform in the not so distant future.
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7027091
Hello,

I know what you are searching for, but this is not so easy: you like to see DES encryption in source code, right?

This does not serve that much. It is a lot of xor and shift operations you have no chance to understand so you can use a DLL or even better a command line tool to pass a string and get encrypted value back. So you can call this tool in LotusScript shell() function to get the encryption.

What platform you will be asking for this non Windows tool?

Or do you prefer Java? If you would use Java you will get only disadvantages. You have to care about encryption service provider classes and Java version dependencies. There is no advantage of portability.

0
 
LVL 10

Expert Comment

by:zvonko
ID: 7028473
0
 

Author Comment

by:HRT_HSV
ID: 7031189
Thanks zvonko, this code will come in handy.

I understand totally what you mean about a Java solution, it's not within my control though so i may eventually have to port this solution to Java.

Thanks again
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7031365
Thank you for the points and for the feedback :-)

Good luck,
zvonko

0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7031418
Hey Buddy !

Good Show!  See you soon beyond 100k !

:-)
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7031656
but not when biggies are graded with an B :(

0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7031667
oh yea i too saw that....poor you!

:-(
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question