SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A questions regarding security

    Hi

    I am working on the website, and the requirement is to receive the data from a FORM and then keep the data ENCRYPTED in the database.

    Now, the thing is that, there are several encryption functions, and each returns the cipher text not the same width as the plain text. So I am not sure what WIDTH i should set in the mysql for the fields. ???

    Moreover, there are some TEXT AREAS in the form with a limit of 500 characters, if it will go to the encryption function, then its cipher code will be may be 800 characters long.

    If i have 40-50 fields in the database, then i would need a lot of space, please guide ??

    Thanks
    Zeeshan

  2. #2
    Web Professional
    Join Date
    Oct 2008
    Location
    London
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It depends on the cipher you use and generally it’s impossible to determine. Just use BLOB type (or variations thereof). You won’t need much space as BLOB uses L+2 bytes (and L+1, L+3, L+4 for TINYBLOB, MEDIUMBLOB and LONGBLOB respectively).

  3. #3
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    okay, thats great !

    So you mean if I use BLOB for all my column, that will be oK right ?
    so what about the OverHead ? BLOB will occupy whole of its space ? OR just the space of that data ?

    Like suppose if BLOB can hold 1000 Characters, and my data in that column has 60 characters, so will blob still occupy the whole 1000 or will just use 50 characters ?

    Is that feasible to use in terms of database overhead ?

  4. #4
    Web Professional
    Join Date
    Oct 2008
    Location
    London
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It will occupy the size of your data + 2 bytes to store the size. So 60 bytes of data in BLOB column will take up 62 bytes.

    TINYBLOB uses 1 extra byte to store size, MEDIUMBLOB 3 bytes and LONGBLOB 4 bytes.

  5. #5
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay thanks a lot !
    It means its overhead is not very much, and I can set each of my column as BLOB !


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •