EldoS | Feel safer!

Software components for data protection, secure storage and transfer

AES 256 creation using TElPGPSecretKey.Generate

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#29026
Posted: 03/29/2014 17:03:14
by Eugene Mayevski (EldoS Corp.)

Once again - there are different sets of assemblies provided, including the set for .NET 2.0. You need to install it and then reference it properly.

Now about your problem - you can install version 11 separately, run its sample project and see if it works for you. If it doesn't, then we can dig deeper into the problem.


Sincerely yours
Eugene Mayevski
#29027
Posted: 03/29/2014 17:08:20
by Natale Montalto (Basic support level)
Joined: 03/25/2014
Posts: 8

let me try what you suggested.. I could put in a independent project and give it a try with 11.
thanks
Natale
#29028
Posted: 03/29/2014 21:13:50
by Natale Montalto (Basic support level)
Joined: 03/25/2014
Posts: 8

Hi Eugene
I did just try in with Framework 4.0 Visual Studios 2010 secureBlackBox dlls version 11 and it had the same issue

{SBPGPExceptions.EElPGPUnsupportedAlgorithmException: Unknown Public Key algorithm" & vbCrLf & " at SBPGPKeys.TElPGPCustomSecretKey.Generate(String Password, Int32 Bits, Int32 Algorithm, Boolean UseOldFormat, Int32 Expires)" & vbCrLf & " at SBPGPKeys.TElPGPSecretKey.Generate(String Password, Int32 KeyBits, Int32 KeyAlgorithm, Int32 SubkeyBits, Int32 SubkeyAlgorithm, String UserName, Int32 Expires)" & vbCrLf & " at PGPKeysDemo.frmGenerateKey.GenerateKey() in C:\Documents and Settings\All Users\Documents\EldoS\SecureBlackbox.NET\Samples\VB.NET\OpenPGPBlackbox\Desktop\PGPKeysDemo\GenerateKeyForm.vb:line 561}

thanks
Natale
#29029
Posted: 03/30/2014 02:56:15
by Eugene Mayevski (EldoS Corp.)

Thank you, now the problem is clear. AES256 is not a public key algorithm. The keypair is a pair of asymmetric keys (RSA, DSA or Elgamal). Symmetric algorithms are used for data encryption.

If you look at documentation for Generate method, you will see the list of allowed algorithms, and they all are public key algorithms.

To protect the secret key with AES256 you need to set EncryptionAlgorithm property to SB_PGP_ALGORITHM_SK_AES256 .


Sincerely yours
Eugene Mayevski
#29030
Posted: 03/30/2014 03:45:41
by Eugene Mayevski (EldoS Corp.)

I am sorry, EncryptionAlgorithm property is read-only. Use ChangeProtection method to protect the key.


Sincerely yours
Eugene Mayevski
#29035
Posted: 03/30/2014 09:45:55
by Natale Montalto (Basic support level)
Joined: 03/25/2014
Posts: 8

Thanks Eugene
If finally penetrated this thick skull about Asymmetric and Symmetric keys.
and that SecretKey.Generate only creates Asymmetric keys.
I am knew with encrpytion so I really did not know the difference. I did a little research and the light went oh. In our document at work they suggest encrypting via AES-256.. two things they did not say is that it was Symmetric and two usually used only for mail.

thanks Again
Natale
#29056
Posted: 03/31/2014 15:51:23
by Steven Overbeek (Standard support level)
Joined: 03/27/2014
Posts: 6

Hi Eugene
I am able to create the keypair Asymmectric keys. I am still having issue with creating a Symmectric key. I know I can't use secretKey.generate. I have attempted to use

Dim secureSymetricKey As SBSymmetricCrypto.TElSymmetricKeyMaterial
secureSymetricKey.Algorithm = CType(CipherNumber, Integer)
secureSymetricKey.Generate(KeyBitSizes)

However it does not like the commands in .Net. Am I on the right path or am I just pulling up dandelions?

thanks
Natale
#29060
Posted: 03/31/2014 17:05:11
by Ken Ivanov (EldoS Corp.)

Hello Natale,

The secret key is created for you by the TElPGPWriter component for each protection operation independently. The only thing you need to do is assign the desired encryption algorithm constant to the SymmetricKeyAlgorithm property:

Code
writer.SymmetricKeyAlgorithm = SBPGPConstants.Unit.SB_PGP_ALGORITHM_SK_AES256;


Ken
#29089
Posted: 04/02/2014 10:28:06
by Steven Overbeek (Standard support level)
Joined: 03/27/2014
Posts: 6

Hi Ken
That did not work for me. I will include the code that I used. It came up zero bytes.


Dim writer As TElPGPWriter
Dim MemStream As System.IO.MemoryStream

CipherNumber = SBPGPConstants.Unit.SB_PGP_ALGORITHM_SK_AES192

writer = New TElPGPWriter
MemStream = New System.IO.MemoryStream(writer.SymmetricKeyAlgorithm = CipherNumber)
#29090
Posted: 04/02/2014 10:32:55
by Eugene Mayevski (EldoS Corp.)

What is your code (especially MemoryStream constructor) supposed to do?


Sincerely yours
Eugene Mayevski
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

Topic viewed 3007 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!