SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict Divisive Cotton's Avatar
    Join Date
    Jun 2008
    Location
    Andy lives in London, UK
    Posts
    393
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A quick question on encryption

    If I was to use the mcrypt library as I understand it then that will increase the size of the data what will be stored in the database, yes?

    So lets say I have a field that is varchar 50 characters, then would size would it need to be if I was to use mcrypt?
    Let everyday be Christmas

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,820
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    It would depend on which of the cyphers listed at http://www.php.net/manual/en/mcrypt.ciphers.php that you decide to use - most should at most add a byte or two to the length of whatever you feed into it.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Addict Divisive Cotton's Avatar
    Join Date
    Jun 2008
    Location
    Andy lives in London, UK
    Posts
    393
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ask this because I was looking at the CodeIgniter encryption class and their guide states:

    Message Length

    It's important for you to know that the encoded messages the encryption function generates will be approximately 2.6 times longer than the original message. For example, if you encrypt the string "my super secret data", which is 21 characters in length, you'll end up with an encoded string that is roughly 55 characters (we say "roughly" because the encoded string length increments in 64 bit clusters, so it's not exactly linear). Keep this information in mind when selecting your data storage mechanism. Cookies, for example, can only hold 4K of information.
    http://codeigniter.com/user_guide/li...ncryption.html
    Let everyday be Christmas

  4. #4
    SitePoint Wizard frank1's Avatar
    Join Date
    Oct 2005
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Divisive Cotton View Post
    I ask this because I was looking at the CodeIgniter encryption class and their guide states:



    http://codeigniter.com/user_guide/li...ncryption.html
    I agree...generally encrpyption do increase the text length...plus we have extra work or encryption and decryption(thats why we encrypt important parts only)
    ya when i use to use CI,I think i have also read it about nature of its default encrypter.If you dont like it i think you can play with it to get another encrypter.

    Thanks

  5. #5
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are encrypting a code in itself, i suggest you to use ioncube

    Thanks
    PHPycho - Magento Freelancer
    Free Modules: jQuery LightBoxes | Frontend Links Manager & more...
    Commercial Modules: Custom Login Redirect Pro | Store Restrction Pro & more...

    Follow me on Twitter @ magepsycho

  6. #6
    SitePoint Wizard frank1's Avatar
    Join Date
    Oct 2005
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by PHPycho View Post
    If you are encrypting a code in itself, i suggest you to use ioncube
    Thanks
    The standard license of ioncube cost around $400 so,may not be good for small general purpose application.
    You need have ioncube installed in your deployment server(which most servers have now a days)
    plus it is not unbreakable encryption,now a days there are many people claiming to decrypt it for very negligible fees....
    so,it is having wall and leaving other things to ability of cracker...

    but suggestion in not bad


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
  •