PHP Classes
elePHPant
Icontem

Laravel HTML Encoding: Obfuscate HTML encoding it a JavaScript code

Recommend this page to a friend!
  Info   View files Documentation   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-10-03 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 63 This week: 2All time: 8,984 This week: 345Up
Version License PHP version Categories
laravel-html-encodin 1.0.0The PHP License5HTML, PHP 5
Description Author

This package can obfuscate HTML encoding it a JavaScript code.

It takes an HTML string and generates HTML with JavaScript code which when loaded in a Web page, it would render the given HTMl code on a Web page.

  Performance   Level  
Name: Nyi Nyi Lwin <contact>
Classes: 2 packages by
Country: Myanmar Myanmar
Age: 25
All time rank: 41065 in Myanmar Myanmar
Week rank: 326 Up1 in Myanmar Myanmar Up

Details

Laravel Html Encrypt

Latest Stable Version Total Downloads

Installation

You can install the package via composer:

 composer require php-junior/laravel-html-encrypt

Once installed, in your project's config/app.php file replace the following entry from the providers array:

PhpJunior\LaravelHtmlEncrypt\LaravelHtmlEncryptServiceProvider::class,

And

php artisan vendor:publish --provider="PhpJunior\LaravelHtmlEncrypt\LaravelHtmlEncryptServiceProvider"

This is the contents of the published config file:

return [
    'disable_right_click'       => true,
    'disable_ctrl_and_F12_key'  => true,
];

Next you must add the \PhpJunior\LaravelHtmlEncrypt\Middleware\HtmlEncrypt middleware to the kernel.

// app/Http/Kernel.php

...
protected $middleware = [
    ...
    \PhpJunior\LaravelHtmlEncrypt\Middleware\HtmlEncrypt::class,
];

HTML Encryption?

One major reason for the success of the World Wide Web is undeniably the openness of HTML. HTML files are basically plain text documents, meaning software applications and human users can easily create, read, and update web pages. The open nature of HTML not only allows users to edit websites with nothing more than a simple text editor, it also enables search engines to spider the web and forms the basis for a wide range of web-related applications for any platform you can imagine.

However, as a web designer or website owner you may encounter situations in which you feel a need for protecting your HTML, CSS or JavaScript code from being viewed and reused .

How It Works

HTML encryption/decryption techniques are based on JavaScript. The encrypted HTML code, which is saved inside the HTML document, is decrypted at runtime through JavaScript and written directly into the browser window using the document.write(?) function. This ensures that any JavaScript-enabled web browser can load and display the pages without additional components or plugins.

License

The MIT License (MIT). Please see License File for more information.

  Files folder image Files  
File Role Description
Files folder imageconfig (1 file)
Files folder imagesrc (1 file, 1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file laravel-html-encrypt.php Aux. Auxiliary script

  Files folder image Files  /  src  
File Role Description
Files folder imageMiddleware (1 file)
  Plain text file LaravelHtmlEncryptServiceProvider.php Class Class source

  Files folder image Files  /  src  /  Middleware  
File Role Description
  Plain text file HtmlEncrypt.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:63
This week:2
All time:8,984
This week:345Up