Page 1 of 3 123 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Location
    Madurai,India
    Posts
    59
    Rep Power
    6

    My New Base128 encoding Evaluate it !


    Here is my New Base128 encoding

    Here is the format

    those you can't see the pictures

    http://www.ramanean.com/project/base...-original1.GIF












    You can see the attachment for more details...

    This how it works Base128:

    For the words :"SHANMUG" it is encoded as "[|˝8-WŁ‹" (8 bytes)

    Here the a 7 bytes string is encoded as 8 bytes string(base128)

    "S" is converted to "57" and corresponding value for 57 in the table is used to encode "S"

    Base64:

    word="SHANMUG" base64 encoding-"U0hBTk1VRw==" (12 bytes)

    whereas in base64 encoding a 7 bytes string is encoded as 12 bytes string (So there is a loss of5 bytes ) but in base128 encoding only 1 byte is lost in encoding a 7 byte string into 8 byte string (Only a loss of 1 byte)

    Advantages of base128 encoding

    a)occupies less space when compared with base64 encoding (base128)



    b)when data is being transmitted by base128 encoding it makes the data transfer easier as only less amount of data needs to be transmitted when comapred with base64

    I have also attached a php file with it (which I tested it my home )

    Download it and save it as .php

    and when you want to encode something use this

    sample program make sure that 'base128.php' exists in the same folder.
    PHP Code:
     <?php 

    require_once 'base128.php'

    $a=base128_encode("shanmugam"); 

    //To decode it 

    $b=base128_decode($a); 

    ?>
    Base128 encoding:

    Base128 encoding in Php


    So each 7 character string would be converted into 8 character string in base128

    whereas a 6 character string would be converted into 8 character string in base64...
    Attached Images
    Attached Files
    Last edited by Freewebspace; September 27th, 2008 at 12:51 AM.
  2. #2
  3. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Sep 2007
    Location
    outside Washington DC
    Posts
    2,642
    Rep Power
    3699
    What is the point of this? The point of base64 is to take binary data and convert it to characters that can safely and reliably be delivered over email and other systems that don't like binary.

    There are 32 non-printable characters in the ascii seven bit sequence, and many of the 8 bit characters are not printable.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Location
    Madurai,India
    Posts
    59
    Rep Power
    6
    Originally Posted by fishtoprecords
    What is the point of this? The point of base64 is to take binary data and convert it to characters that can safely and reliably be delivered over email and other systems that don't like binary.

    There are 32 non-printable characters in the ascii seven bit sequence, and many of the 8 bit characters are not printable.
    This is just another encoding which can be used for encoding data in files and storing it in your systems in databases

    Are you talking about a encrypted mail or something other that ?

    Can you please elaborate?
    Last edited by Freewebspace; September 26th, 2008 at 12:05 PM.
  6. #4
  7. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Sep 2007
    Location
    outside Washington DC
    Posts
    2,642
    Rep Power
    3699
    Originally Posted by Freewebspace
    This is just another encoding which can be used for encoding data in files and storing it in your systems in databases
    Why would you use it? Just store the strings or the binary.
    I'm not seeing any value in this at all.

    Originally Posted by Freewebspace
    Are you talking about a encrypted mail or something other that ?
    Base64 encoding is used for binary values in mail. Any kind of binary, say a GIF, jpg, mp3, etc.

    While one can encrypt a binary file and then base64 encode the output, the concept of base64, mime, or uuencode, goes back decades.

    As I asked before, what is the value of your encoding? what problem does it solve that is not solved as well by something that has been used reliably for decades?
  8. #5
  9. Arcane Scribbler
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2005
    Location
    Indianapolis, IN
    Posts
    1,907
    Rep Power
    584
    Originally Posted by Freewebspace
    This is just another encoding which can be used for encoding data in files and storing it in your systems in databases

    Are you talking about a encrypted mail or something other that ?

    Can you please elaborate?
    No, he's not. Base64 simply encodes binary data to ASCII characters that are guaranteed to be printable.

    From the Wikipedia article for Base64:
    The particular choice of base is due to the history of character set encoding: one can choose a set of 64 characters that is both part of the subset common to most encodings, and also printable.
    From the Wikipedia article for [url=http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters[/url]ASCII, in the section 'ASCII Printable Characters':
    Codes 33 to 126, known as the printable characters, represent letters, digits, punctuation marks, and a few miscellaneous symbols.
    33 to 126. That's only 94 printable characters.

    Base128 is impossible on those grounds.

    An while 7 bytes is encoded as 12 characters in Base64, it's an acceptable loss for every 3 bytes to be encoded as 4 characters when the purpose of the encoding is serialization of binary data. The benefit is integrity of the transmission (or storage) versus a little bit of space.

    You can say that it bloats the size of the data by nearly 200%, but the fact is your example is incredibly small and a poor respresentation. Encode 8096 bytes in Base64 and it becomes 10796 bytes. That's a much better representation of the 3:4 ratio.

    Edit: And furthermore, 3:4 works better in another way. In Base64, you're 3 8-bit segments into 4 6-bit segments. Base128 would be encoding 8-bit segments into 7-bit segments. For the 8-bit binary segments to align with the 7-bit segments, you need 7 8-bit segments that get encoded to 8 7-bit segments. Much, much messier for saving just a little bit of space (and what space you do save probably gets eaten up by 0-padding at the end).
    Last edited by LyonHaert; September 26th, 2008 at 12:45 PM.
    Joel B Fant
    "An element of conflict in any discussion is a very good thing. Shows everybody's taking part, nobody left out. I like that."

    .NET Must-Haves
    Tools: Reflector
    References: Threading in .NET
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Location
    Madurai,India
    Posts
    59
    Rep Power
    6
    I created it for just experimental purposes to send my own encoded data so it could not be decoded by anyone...

    So only I can decode it...


    I am just using it for fun purposes..
    Last edited by Freewebspace; September 26th, 2008 at 01:13 PM.
  12. #7
  13. Arcane Scribbler
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2005
    Location
    Indianapolis, IN
    Posts
    1,907
    Rep Power
    584
    Originally Posted by Freewebspace
    I am just using it for fun purposes..
    That's fine, but posting on a public forum conveys an implicit message that you want others to use it, as well as being an invitation for critique. For experimentation and learning and just fun, I can't say you're doing anything wrong. Many experiments and for-fun projects have little to no practical merit.

    Originally Posted by Freewebspace
    I created it for just experimental purposes to send my own encoded data so it could not be decoded by anyone...

    So only I can decode it...
    If what you really want is to hide your data, then you need to look at encryption. Encoding is just a different way of representing the same data. Like Unicode vs UTF8 vs UTF7, the purpose of an encoding is not to hide the data, but to represent the data. If encoding is needed (e-mail, etc.), then you would encode after encrypting.

    Also, you posted it publicly, so that bit about only you decoding it is out the window. Besides, secrecy of an algorithm or whatever does not enhance its security, but almost always hinders it.
    Joel B Fant
    "An element of conflict in any discussion is a very good thing. Shows everybody's taking part, nobody left out. I like that."

    .NET Must-Haves
    Tools: Reflector
    References: Threading in .NET
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Location
    Madurai,India
    Posts
    59
    Rep Power
    6
    Originally Posted by LyonHaert
    That's fine, but posting on a public forum conveys an implicit message that you want others to use it, as well as being an invitation for critique. For experimentation and learning and just fun, I can't say you're doing anything wrong. Many experiments and for-fun projects have little to no practical merit.
    I posted it on a public forum as I can get good inputs from others whether it works fine or not...

    Because I got a couple of good inputs about the script I wrote for it ..(I am modifying the script).

    Also note it that you can use 128^128 combinations... when using this algorithm..

    I can use a one that can be different from a set of others..

    E.g S=>57=>"["

    Some others can use another character for the same "57" => "F"



    Originally Posted by LyonHaert
    If what you really want is to hide your data, then you need to look at encryption. Encoding is just a different way of representing the same data. Like Unicode vs UTF8 vs UTF7, the purpose of an encoding is not to hide the data, but to represent the data. If encoding is needed (e-mail, etc.), then you would encode after encrypting.

    Also, you posted it publicly, so that bit about only you decoding it is out the window. Besides, secrecy of an algorithm or whatever does not enhance its security, but almost always hinders it.

    But here since there are 128^128 combinations

    I may be using a different set of combinations each time...

    I use encoding to always hide the data...
  16. #9
  17. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Sep 2007
    Location
    outside Washington DC
    Posts
    2,642
    Rep Power
    3699
    Originally Posted by Freewebspace
    I use encoding to always hide the data...
    What do you mean here? Most folks use cryptography to protect data. "hide" could mean nearly anything, including SBO (Security by Obscurity) which is well known to be useless.

    Real crypto is not hard to use, if that's what you want, you should use it.
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Location
    Madurai,India
    Posts
    59
    Rep Power
    6
    Originally Posted by fishtoprecords
    What is the point of this? The point of base64 is to take binary data and convert it to characters that can safely and reliably be delivered over email and other systems that don't like binary.

    There are 32 non-printable characters in the ascii seven bit sequence, and many of the 8 bit characters are not printable.
    I am making those characters printable...(You can see it in the pic I provided)

    Originally Posted by fishtoprecords
    What do you mean here? Most folks use cryptography to protect data. "hide" could mean nearly anything, including SBO (Security by Obscurity) which is well known to be useless.

    Real crypto is not hard to use, if that's what you want, you should use it.
    I misquoted a word there.. hide =>protect data...
    Last edited by Freewebspace; September 27th, 2008 at 01:15 AM.
  20. #11
  21. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Sep 2007
    Location
    outside Washington DC
    Posts
    2,642
    Rep Power
    3699
    Originally Posted by Freewebspace
    I misquoted a word there.. hide =>protect data...
    Protect from what? I'm still not understanding why this is useful.

    Computers are good at moving bytes without errors.

    What are you trying to do, really?
  22. #12
  23. Crypto-Con
    Devshed Supreme Being (6500+ posts)

    Join Date
    Apr 2004
    Location
    Frisco, Texas
    Posts
    6,704
    Rep Power
    1236
    Originally Posted by Freewebspace
    I misquoted a word there.. hide =>protect data...
    I think you're under the misperception that encoding data protects or hides it. Sure someone glancing at your screen won't be able to read encoded data, but it won't be safe from anyone who gets physical access to it, or even anyone with a pencil, notepad, and a quick minute alone with your screen. Encoding is easy to reverse with just the data -- it's supposed to be. Encryption is supposed to be hard to reverse with just the data. At best you're protecting it from technologically unsavy passers-by.
    - "Cryptographically secure linear feedback shift register based stream ciphers" -- a phrase that'll get any party started.
    - Why know the ordinary when you can understand the extraordinary?
    - Sponsor my caffeine addiction! (36.70 USD received so far -- Latest donor: Mark Foxvog.
    )
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Location
    Madurai,India
    Posts
    59
    Rep Power
    6
    I am trying to save and protect the data

    In Proxies , they mostly use base64 encoding.. If they use base128 encoding they can save a lot of bandwidth+protect the data from softwares like Websense..
    Last edited by Freewebspace; September 27th, 2008 at 11:33 PM.
  26. #14
  27. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Sep 2007
    Location
    outside Washington DC
    Posts
    2,642
    Rep Power
    3699
    Originally Posted by Freewebspace
    I am trying to save bytes (... For this I am using this...
    Make up your mind. Saving space is typically done with something like LZW, not an encoding. Saving space has nothing to do with protection, or hiding.

    Look up compression, lzw, huffman coding, and get familiar with the terms.
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Location
    Madurai,India
    Posts
    59
    Rep Power
    6
    I have already clearly stated why I am trying to save space..

    Proxies when use use base64 encoding for every 3 bytes it takes up 4 bytes

    Here it takes For Every 7 bytes it takes up 8 bytes..

    Suppose if a webpage of 30KB is fetched in proxies it would use 40 KB

    But if you use this...it would take 40 KB for a 35 KB page...
Page 1 of 3 123 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo