I can't find session.DecryptUpdate

2/28/2013 9:22:01 PM
Gravatar
Total Posts 7

I can't find session.DecryptUpdate

Dear Ugo,

I want to implement encrypt / decrypt functions using SafeNet.CKM_DES3_ECB_PAD mechanism. For encryption I have the following function:

 

Function EncryptDES3_ECB_PAD(ByVal clearInput As Byte(), ByVal key As SecretKey, ByVal session As Session) As Byte()
Dim output() As Byte

Dim DES3_ECB_PAD As Mechanism
Dim param As Object
DES3_ECB_PAD = New Mechanism(SafeNet.CKM_DES3_ECB_PAD, param)

Dim nRes As Integer
nRes = session.EncryptInit(DES3_ECB_PAD, key)

clearInput = session.EncryptUpdate(clearInput)

output = session.EncryptFinal

Return output
End Function

 

For decryption I need to use the primitives: C_DecryptInit with SafeNet.CKM_DES3_ECB_PAD mechanism, C_DecryptUpdate and C_DecryptFinal.

I founded the functions DecryptInit and DecrypFinal, but I can't found the DecryptUpdate that supose to call the C_DecryptUpdate.

 

Can you help me with this issue!

I used the demo NCryptoki v.1.5.3.2!

 

Thank you in advanced!

 

 

3/1/2013 1:28:51 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: I can't find session.DecryptUpdate

Hi,

you are right. We have just seen that DecryptUpdate is non exported in the latest version.

We are going to release e new version tomorrow with DecryptUpdate method.

I'll update you as soon as it is available.

3/3/2013 7:32:18 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: I can't find session.DecryptUpdate

You can now download the new version with DecryptUpdate method.

Let's know

3/3/2013 8:48:02 PM
Gravatar
Total Posts 7

Re: I can't find session.DecryptUpdate

  Hi Ugo,

 

Thank you for the new version! The function DecryptUpdate it is included!

 

After I updated the NCryptoki.dll file version 1.5.4.1 , I received the following exception:

"Could not load file or assembly 'NCryptoki, Version=1.5.3.2, Culture=neutral, PublicKeyToken=6a3e54934ab72177' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

 

Can you advise me please!

3/4/2013 11:23:43 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: I can't find session.DecryptUpdate

Hi,

NCryptoki.dll assembly is strongnamed, this means that you should update all references in your projects and recompile with the new version.

You got that error because your application still wants the old version.

3/5/2013 8:30:22 PM
Gravatar
Total Posts 7

Re: I can't find session.DecryptUpdate

Hi,

 

I received also this exception when I run CryptokiExplorera application from the NCryptoki1.5.4.1 package:  "Could not load file or assembly 'NCryptoki, Version=1.5.3.2, Culture=neutral, PublicKeyToken=6a3e54934ab72177' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)".

In my program I removed the reference to NCryptoki.dll version 1.5.3.2 and create new one to library  NCryptoki.dll version 1.5.4.1 !

 

Also the only assembly is the  c:\WINDOWS\assembly\GAC_MSIL\NCryptoki\1.5.4.1__6a3e54934ab72177\NCryptoki.dll

 

Can you advise that other checks I need to perform in order to be able to use the last NCryptoki library!

 

Thank you in advanced!

 

Regards,

  Externus

3/6/2013 5:18:44 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: I can't find session.DecryptUpdate

In the latest package I updated all dlls and exes.

In the CryptokiExplorer folder you can find the updated version of CryptokiExplorer.exe that takes the latest version of NCryptoki assembly.

 

3/12/2013 9:41:08 PM
Gravatar
Total Posts 7

Re: I can't find session.DecryptUpdate

Hi Ugo,

 

I've create a new simple project on a computer where it was not installed any version of the NCryptoki! The code we can find below! I have add references to NCryptoki.dll version 1.5.4.1 and NCryptokiMngd.dll version 1.1.1.2. The exception is the: "Could not load file or assembly 'NCryptoki, Version=1.5.3.2, Culture=neutral, PublicKeyToken=6a3e54934ab72177' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

 

Imports Cryptware.NCryptoki
Imports Cryptware.NCryptokiMngd
Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cryptoki As Cryptoki
cryptoki = New Cryptoki("C:\Program Files\SafeNet\ProtectToolkit C SDK\bin\sw\cryptoki.dll")
Cryptoki.Initialize()
End Sub
End Class

 

Risking to bother you, can you check again the new release; please advise me where I wrong!

 

Thank you in advanced!

Regards,

  Externus

3/13/2013 1:18:22 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: I can't find session.DecryptUpdate

Hi,

we find the problem. We put in the latest package a wrong version of NCryptokiMngd.dll

We really sorry for the inconvenience. To much stress ;)

You can now get the new fixed version in the download section.

Let me know...

3/18/2013 8:02:20 PM
Gravatar
Total Posts 7

Re: I can't find session.DecryptUpdate

Hi Ugo,

 

I've tested and works perfect now!

 

Thank you for your support!

 

Regards