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!
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.
You can now download the new version with DecryptUpdate method.
Let's know
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!
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.
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!
Regards,
Externus
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.
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!
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...
I've tested and works perfect now!
Thank you for your support!
Regards