Re: 128 bit blowfish algorithm (General questions)
I have applied what you have send me
the coding follows:
Dim crypt As New wodCryptCom
Dim i_blob As New MemBlob
Dim o_blob As New MemBlob
'i_blob.Text = 1271
i_blob.FromBase64( 1271 )
crypt.Type = CryptoTypes.Blowfish
crypt.SecretKey = 1111222233334444 '16byte key
crypt.Optimized = False
crypt.Padding = WODCRYPTCOMLib.CryptoPadding.PadPKCS7
crypt.Encrypt(i_blob, o_blob)
Dim str As String = o_blob.ToBase64
Response.Write(str)
Response.Write( <br> )
i_blob.FromBase64(str)
crypt.Decrypt(i_blob, o_blob)
Response.Write(o_blob.ToBase64)
the result is:
Encrypted value: gcnw/sxIYbM=
decrypted value: 1271
it runs fine but
We are using Product of TurboPower
it gives result:
Encrypted value: Hft4sSl5T5s=
decrypted value: 1271
so why these two encrypted values are not matched.
if this due to change of value to or from base64?
if there any error in avove coding?
sovan
Sovan,
that's not 128bit. It all depends on the lenght of the secret key. You must use 16 bytes key (128bit) to have 128bit Blowfish.
BTW in your code you specify 'SecretKey' and 'Password'? Perhaps you mixed them? Perhaps you used Base64 to read it in some cases, and forgot to use it in another cases?
Do you use CBC mode? If so, is your InitVector the same in all cases?
Kreso
Complete thread:
- 128 bit blowfish algorithm - sovan, 2006-07-31, 10:37
- Re: 128 bit blowfish algorithm - wodDamir, 2006-07-31, 12:02
- Re: 128 bit blowfish algorithm - sovan, 2006-07-31, 13:46
- Re: 128 bit blowfish algorithm - wodDamir, 2006-07-31, 14:40
- Re: 128 bit blowfish algorithm - wodSupport, 2006-07-31, 16:57
- Re: 128 bit blowfish algorithm - sovan, 2006-08-01, 09:42
- Re: 128 bit blowfish algorithm - wodSupport, 2006-08-01, 09:46
- Re: 128 bit blowfish algorithm - sovan, 2006-08-01, 12:54
- Re: 128 bit blowfish algorithm - wodSupport, 2006-08-01, 15:33
- Re: 128 bit blowfish algorithm - sovan, 2006-08-02, 06:46
- Re: 128 bit blowfish algorithm - wodDamir, 2006-08-02, 08:46
- Re: 128 bit blowfish algorithm - sovan, 2006-08-02, 10:11
- Re: 128 bit blowfish algorithm - wodDamir, 2006-08-02, 08:46
- Re: 128 bit blowfish algorithm - sovan, 2006-08-02, 06:46
- Re: 128 bit blowfish algorithm - wodSupport, 2006-08-01, 15:33
- Re: 128 bit blowfish algorithm - sovan, 2006-08-01, 12:54
- Re: 128 bit blowfish algorithm - wodSupport, 2006-08-01, 09:46
- Re: 128 bit blowfish algorithm - sovan, 2006-08-01, 09:42
- Re: 128 bit blowfish algorithm - wodSupport, 2006-07-31, 16:57
- Re: 128 bit blowfish algorithm - wodDamir, 2006-07-31, 14:40
- Re: 128 bit blowfish algorithm - sovan, 2006-07-31, 13:46
- Re: 128 bit blowfish algorithm - wodDamir, 2006-07-31, 12:02