Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DES encryption via Lotusscript or Java  web Agent

Posted on 2002-05-19
14
Medium Priority
?
1,202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

722 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