optimum mysql column type definition for blowfished data

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

optimum mysql column type definition for blowfished data

stevepiercy
Let's say you have a text string of length 6-20 characters.  encrypt_blowfish2 the string with a seed of 112 characters.  In order to store the result in a mysql database, what would be the optimum column type definition?

I've come up with varchar length=20.  Are there any experts who know for certain what is optimum?

--steve
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                   <http://www.StevePiercy.com>

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: optimum mysql column type definition for blowfished data

Marc Pope
VarChar 20 would only store 20 characters, I assume the length of the  
blowfish encrypted data would be much longer. You could randomize a  
bunch of strings that are that length and see what the average length  
is.

Marc


On Sep 3, 2006, at 4:02 PM, Steve Piercy - Web Site Builder wrote:

> Let's say you have a text string of length 6-20 characters.  
> encrypt_blowfish2 the string with a seed of 112 characters.  In  
> order to store the result in a mysql database, what would be the  
> optimum column type definition?
>
> I've come up with varchar length=20.  Are there any experts who  
> know for certain what is optimum?
>
> --steve
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                   <http://www.StevePiercy.com>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: optimum mysql column type definition for blowfished data

Bil Corry-3
Marc P. wrote:
> VarChar 20 would only store 20 characters, I assume the length of the
> blowfish encrypted data would be much longer. You could randomize a
> bunch of strings that are that length and see what the average length is.

And the blowfish tags return binary data, so the column type would have to support binary data.


- Bil


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: optimum mysql column type definition for blowfished data

stevepiercy
On Monday, September 4, 2006, [hidden email] (Bil Corry) pronounced:

>Marc P. wrote:
>> VarChar 20 would only store 20 characters, I assume the length of the
>> blowfish encrypted data would be much longer. You could randomize a
>> bunch of strings that are that length and see what the average length is.
>
>And the blowfish tags return binary data, so the column type would have to support binary
>data.

Ya, I did a bunch of tests, and that's how I came up with varchar length=20.  I added binary option.

Although I later learned that it is not possible to search on Blowfished data, because (and this is what was strange to me) every time data is Blowfished, it can produce a different result even though the same seed and string to be encrypted are used each time.  I had assumed wrongly that data would always produce the same result when Blowfished.  I wasted a good chunk of time learning that lesson.

--steve
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                   <http://www.StevePiercy.com>

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage