EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Signatue Mode - Text or Binary

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#15315
Posted: 12/16/2010 18:19:38
by Shane Fulton (Basic support level)
Joined: 12/16/2010
Posts: 2

Hi,

I'm just doing some testing with Secure Black Box, and Im using the EncryptAndSign method to encrypt a file. Im just wondering if this method uses Binary-mode for signatures by default. I have ascii Armor set to False, so the resulting file is in Binary-Mode - but Im not sure if this applies to the signature also.

Thanks
#15318
Posted: 12/16/2010 22:09:28
by Eugene Mayevski (EldoS Corp.)

Assuming that you are asking about OpenPGP, default mode for everything is binary. Text mode is not common in cryptography world.


Sincerely yours
Eugene Mayevski
#15320
Posted: 12/16/2010 23:51:58
by Shane Fulton (Basic support level)
Joined: 12/16/2010
Posts: 2

Thanks for the reply. I think what Im doing in BlackBox is correct then.

In order to sign and encrypt the file, Im using this code (shortened a bit for convenience):

Code
' Load key files into the keyring

keyring.Load(publicKeyFile, privateKeyFile, True)
pgpWriter.Armor = False
pgpWriter.Compress = False

' Find the public key to use from the keyring
pubKeyring.AddPublicKey(keyring.PublicKeys(i))

' Get the secret key to use from the keyring
secKeyring.AddSecretKey(keyring.SecretKeys(i))

' Set properties of the PGP writer
With pgpWriter
    .EncryptingKeys = pubKeyring
    .SigningKeys = secKeyring
    .EncryptionType = SBPGP.TSBPGPEncryptionType.etPublicKey
    .Filename = f
    .InputIsText = True
    .Passphrases.Clear()
    .Passphrases.Add(passphrase)
    .Protection = SBPGPConstants.TSBPGPProtectionType.ptNormal
    .SignBufferingMethod = SBPGP.TSBPGPSignBufferingMethod.sbmRewind
    .SymmetricKeyAlgorithm = SBPGPConstants.Unit.SB_PGP_ALGORITHM_SK_3DES
    .Timestamp = DateTime.Now
    .UseNewFeatures = False
    .UseOldPackets = False
End With

' Create PGP output file
Dim inF, outF As System.IO.FileStream
inF = New System.IO.FileStream(f, FileMode.Open)
outF = New System.IO.FileStream(f & ".pgp", FileMode.Create)
PGPPublicKeyPassphrase = passphrase
pgpWriter.EncryptAndSign(inF, outF, 0)


The person trying to decrypt this file is telling me that the file is in binary mode, but the signature is still in text-mode instead of binary mode - this sounds incorrect to me based on what Im doing above. They are using GnuPG to decrypt, not sure if that makes a difference or not.

Thanks,
#15322
Posted: 12/17/2010 00:23:25
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 450

Hi. It seems that's about .InputIsText = true, set it to false.
#15323
Posted: 12/17/2010 00:45:18
by Vsevolod Ievgiienko (EldoS Corp.)

Hello.

Try to set .UseNewFeatures = True
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.

Reply

Statistics

Topic viewed 1101 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!