├── README.md ├── composer.json ├── src └── HtmlEncryptor.class.php └── test ├── demo_encode_over_2000_lines.php ├── encrypt_a_part.php ├── encrypt_all.php └── encrypt_js.php /README.md: -------------------------------------------------------------------------------- 1 | ## What is it? 2 | HTML encrypter protect web pages source code, its hard for people to decrypt the source code but it displays perfectly in a browser. No AdBlocker can read it. It encrypt on the fly and only the web browser can read it. 3 | The size of the first block of code depends on the size of web page, it contains original HTML. The second block of code always stays the same length, it contains the decode function. When opened in a web browser, the original page appears to be unchanged, but the code underneath has been transformed. 4 | 5 | ## Features 6 | - Protect HTML code against fast cribbing copying 7 | - Encode local HTML to prevent in-file searching 8 | - Protect unfinished websites from Google 9 | - Confuse user who click the “View Source” button :D 10 | - Become part of the invisible web, hide from search engines and data miners ;) 11 | - Very lightweight and working on-the-fly 12 | 13 | ## How to install 14 | - git clone https://github.com/moh4mmad/html-encrypter.git 15 | ## Usage 16 | - To encrypt the whole page 17 | ```php 18 | Encrypt(); 23 | ?> 24 | ``` 25 | - To encrypt a part in a page 26 | ```php 27 | 31 | 32 | 33 | 43 | 44 | 45 |

Table Caption

46 |

To add a caption to a table, use the caption tag.

47 | 48 | Encrypt(); ?> 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 |
Monthly savings
MonthSavings
January$100
February$50
65 | EncryptionEnd(); ?> 66 | 67 | 68 | ``` 69 | ## Demo 70 | https://sakib.info/html_encrypter/ 71 | 72 | ## Issues 73 | If you come across any issues please report them [here](https://github.com/moh4mmad/html-encrypter/issues) 74 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sakib/htmlencrypter", 3 | "description": "HTML encrypter protect web pages source code, its hard for people to decrypt the source code but it displays perfectly in a browser. No AdBlocker can read it. It encrypt on the fly and only the web browser can read it", 4 | "type": "library", 5 | "require": { 6 | "php": "5.0" 7 | }, 8 | "license": "MIT", 9 | "authors": [ 10 | { 11 | "name": "Mohammad sakib", 12 | "email": "sakib@sakib.info" 13 | } 14 | ], 15 | "minimum-stability": "dev" 16 | } 17 | -------------------------------------------------------------------------------- /src/HtmlEncryptor.class.php: -------------------------------------------------------------------------------- 1 | variable = 'html_data'; 32 | $this->function_name = 'html_encoder'; 33 | $this->html_tag = 'html_encoder_div'; 34 | 35 | if($this->char_per_line % 3 != 0) 36 | { 37 | throw new Exception('Characters per line must be divisible by 3'); 38 | } 39 | } 40 | 41 | public function Encrypt() 42 | { 43 | ob_start(array($this,'HtmlEncryptor')); 44 | } 45 | 46 | public function EncryptionEnd() 47 | { 48 | ob_end_flush(); 49 | } 50 | 51 | 52 | public function HtmlEncryptor($buffer) 53 | { 54 | if ( rand(0, 1) ) { 55 | 56 | $code = ""; 57 | $out = $this->function_name."(".$this->variable.");\n"; 58 | }else{ 59 | $code = ""; 60 | $out = "document.write('
');\n".$this->function_name."(".$this->variable.");\n"; 61 | } 62 | 63 | $output = " 15 | 16 | 17 | 18 |

My Web Page

19 |

A Paragraph

20 | 21 | 22 | 23 | --------------------------------------------------------------------------------