Hi Michael,

Here is a code snippet. You pass in the plaintext and the key and it returns a Blowfish-encrypted string. BTW it also enhexes the string so that you can pass the string around more easily. UserEncrypter, BTW, is a string that getes generated elsewhere in the application and is just used to pad out the string so that the important part of the plaintext is divisible by 8.


==== end snippet ====
Function encipher(plaintext As String, key As String) As String
  Dim bf As BlowfishCBC

  dim sPlaintext As String
  dim sEncrypted As String
  dim sEncryptedHex As String

  // initialise a new Blowfish object using the key
  bf = new BlowFishCBC(key)

  // Add 7 extra bytes to ensure that Blowfish will encrypt the
  // entire string if its not dividable by 8
  // (this is actually overkill since we determine the string length)
  sPlaintext = plaintext + mid(userEncrypter,1,7)

  // now encrypt the key supplied
  sEncrypted = bf.Encrypt(sPlaintext) + bf.FinishEncrypt()

  // and hex
  sEncryptedHex = DoLocalHex(sEncrypted)

  // send the encrypted and hexed string back to the calling method
  return sEncryptedHex

  // Reset the encryptor so if can be safely used again
  bf.Reset
End Function
==== end snippet ====

I hope this helps.


Ian.
--
Dr Ian M Piper
[EMAIL PROTECTED]
skype: ianmpiper
--
Where is the wisdom we have lost in knowledge?
Where is the knowledge we have lost in information?


On 11 Mar 2006, at 5:53 am, Michael Williams wrote:

Brian,

Thanks for the reply. I've already purchased all the plugins and am very happy with them. I was kind of hoping for a brief code example though. I don't want to read a file and encrypt it's data, I want to encrypt the file as a whole. One would think that you'd just read in a BinaryStream and encrypt it, but all the Einhugur plugins only accept strings as data, and not binary data. Needless to say, I'm having trouble wrapping my head around how to go about this.

Regards,
Michael

On Mar 11, 2006, at 12:44 AM, realbasic-nug- [EMAIL PROTECTED] wrote:


Message: 21
Subject: Re: Einhugur Plugins (e-Cryptit)
From: Brian Rathbone <[EMAIL PROTECTED]>
Date: Sat, 11 Mar 2006 00:44:25 -0500


Michael Williams wrote:
Does anyone have much experience with the e-Cryptit engine and general file encryption? I'm interested in encrypting/decrypting files on a drive. I don't want to encrypt the text within the files, but the file
as a whole.

I've used e-Cryptit for a couple years and have found it to be stable
and it is reasonably priced. You should not have a problem encrypting
files with it.

hth,

Brian

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to