Latest Post
Tampilkan postingan dengan label Encrypt. Tampilkan semua postingan
Tampilkan postingan dengan label Encrypt. Tampilkan semua postingan

jCryption - JQuery Html5 Form encryption plugin Free

Written By Unknown on Rabu, 27 Maret 2013 | 08.45

This plug-in is used for encrypting the data that is submitted through the GTE and POST methods when a JavaScript HTML form is submitted to the server. This plug-in can be easily installed, used and extended. One amazing feature of the jCryption plug-in is that it does not block the web browser during calculations and helps in rendering 2048 bit encryption of the data.


To read more about this article Click Here

For Demo Click Here

To download files Click Here

ionCude PHP encoder - Protect Your PHP Source Code

Written By Unknown on Rabu, 24 Oktober 2012 | 09.40

One of the main threat PHP developers face is that PHP is an interpreted language, means PHP source code is readable by anybody who downloads your application. We can say that it’s a drawback of PHP. But you can protect your intellectual property by encoding your PHP source code. Here in this article I will explain how to protect your PHP source code.

Actually there are many tools available for protecting php code. But here we will discuss ionCude PHP encoder tool. By this tool, you can protect your PHP 4 & 5 source code from easy observation, theft and change. So before releasing your PHP software, you can use the encoder to convert your plain-text PHP files into special encrypted files.

The ionCude PHP Encoder is available for Windows, Linux, FreeBSD and Intel OS X. All versions offer command line access for encoding, and also for creating license files using Pro or Cerberus. This feature is ideal if you wish to automate processing. The Windows Encoder also includes an easy to use GUI, and the Windows Pro and Cerberus editions include a Linux based license generator for PHP scripts too, allowing scripts to be protected using Windows and creating license files from a Linux based web server.

How To Encode PHP source files
Here we will run a php script(phpencoder.php) for encoding its source code.  We will use below command to encode this file.
/usr/local/ioncube/ioncube_encoder5 phpencoder.php -o phpencoder-enc.php

<?php
   echo “MY PHP Encoder Example!”;
?>

You can also Encode an entire project directory by using below command:
/usr/local/ioncube/ioncube_encoder5 projectDir -o build
As There are are many different options available, encoding above script (phpencoder.php) with the default options will return following PHP file.

<?php
    echo(‘Site error: the file <b>’.__FILE__.‘</b> requires the ionCube PHP Loader ’.
    basename($__ln).‘ to be installed by the site administrator.’);
?>
4+oV5BgRgd22U2z7JoK/KmKPIcszhD8pg3hvN+5vc4HFcsGMn/El/4CMYaLFFzaqguLCeb9su8xn  i0+eWxJg/kwNHRkiBvY1aMf1AvwPf14DIwCvegtJC7cbx9cN5jBjwSspVjhVsQnxFx9oBut6R0Kc    V+OLw6XBTNm5sKpbL6DVm2jqk8Wasm9oJgKLZxBtvVBeP5vZrOiod+L7SoplcmTgtyr5wzS3sEzjr7ixXPUY4H82MyuzZyjYTkSKkz9qlMzWHddrUHJX3y0zPfDqWDUeD1BibJQJ9BXkP7jb4pdKQv/hsMqhthNQQRSp6nOJHq8oDDYLE+p403GYs2As9qEI2wNAg6j6ln0BRP7shcbNTb5a8O4VjjLhGDwG
 1AYOxaM4R5QneCFr+xYdtEYSep8FW1i9IBzF1FuDa7eMoPDqaQdjTLAPsy5O831yGpAHohx3FzUK
 aewZTV+tdru=

The ionCube PHP Encoder is a commercial product, there is a limited time Trial Version available for download.

PHP Encrypt/Decrypt - Simple class to encrypt url data

Written By Unknown on Kamis, 27 September 2012 | 09.39

Encryption is useful where critical data is being transferred in url. I have found a simple and secure encryption class with some changes to make it fit for new users. You can use it in Codeigniter websites as well. Just copy it in application/libraries directory and use it in other libraries style.
Here is the code for encryption class.

To read more about this article Click Here


Password Encryption and Decryption Technique in PHP

Written By Unknown on Minggu, 07 November 2010 | 22.19


I’ve noticed that many of my friends are storing password in database without encrypting them. This is really a bad technique because if somebody who has access of the database can easily know the password of the particular person.


The best functions available in PHP for encryption are md5() and sha1(). These both are one way encryping mechanism i.e the string encrypted with md5() or sha1() can’t be decrypted to original string. You might be then wondering how to validate the original string with the encrypted string then you can do this by encrypting the original string and compare both string,

$string='roshan'; //this is original string
$encrypted='d6dfb33a2052663df81c35e5496b3b1b'; //which is md5('roshan')
if(strcmp(md5($string),$encrypted)==0)
  echo"Valid string";
else
  echo"Invalid string";

md5() and sha1() provides the same functinality of encryption in php but they differ in a simple way that md5() generates 32 characters of encrypted string which sha1() generates same of 40 characters.Now let’s look at the different scenario where you need to store the password encrypted in the database and you need to send the originalpasword to the member of your website. In this situation, you can’t use md5() or sha1() because you need to reset the password once if forget it. Now at this time functions like base64_encode() and gzdeflate() comes handy.You can decrypt the password encrypted with base64_encode() with base64_decode() and the same applies for gzdeflate() with gzinflate().

For those guyz who really wants to encrypt and store the password with their own encryption and decryption mechanism then here is the function i’ve used in some of my web projects.

//function to encrypt the string
function encode5t($str)
{
  for($i=0; $i<5;$i++)
  {
    $str=strrev(base64_encode($str)); //apply base64 first and then reverse the string
  }
  return $str;
}
//function to decrypt the string
function decode5t($str)
{
  for($i=0; $i<5;$i++)
  {
    $str=base64_decode(strrev($str)); //apply base64 first and then reverse the string}
  }
  return $str;
}

In this function, i’ve encrypted the string 5 times with base64_encode and reversing the string with strrev() and for decrypting 5 times by reversing the string first then applying base64_decode() .

Free PHP Encryption Software

Written By Unknown on Kamis, 06 Mei 2010 | 03.18

A software developer is faced with a potential troublesome issue. When all the programming is done, and it's time to distribute the actual program, the question arises: How do I protect my intellectual property from being misused, changed and sold by a potential user of my program? Of course there are Copyrights, but not all users might be aware or care about it.



                                                             
                                                            unencrypted code

Usually this is not a problem when using ordinary executable files. The customer would have a hard time opening up the file in Notepad, figuring out and modifying the code. This process is called reverse engineering, and for some people this is an art.

                                                                  encrypted code


The problem is a bit trickier when programming in an open format such as ASP, PHP or any type of scripting. The program is easily readable and sometimes ingenious and potential lucrative algorithms could fall into the wrong hands. But there is a solution. This article is focused on how to protect your PHP scripts using obfuscation techniques that makes the program unreadable for humans - but still fully functional for a computer.
There are several commercial tools that solves this problem for you. A selection of these tools are:

SourceGuardian PRO for PHP : PHP Encoder

SourceGuardian PRO for PHP is best known as the "PHP Encoder". It is an advanced package with a long list of features for making the resulting code as hard to read as possible. At the time of writing this software lands at $250 for a full license. Some of the main features are: Requires no additions to the running server, Lock to multiple domain names, Full bytecode Encryption and it is PHP5 compatible. In order to test this software you need to register for a single user trial license on their home page.

ionCube PHP Encoder

ionCube PHP Encoder is only one of ionCube's web based software. At the time of writing it is a little bit easier on the wallet compared to SourceGuardian at $199 for the entry level license. Key features: Bytecode encryption, ASCII or binary format and Digital signature encryption. An evaluation version is available after registering on their home page.

Zend encoder

Zend are actually the ones responsible and involved in creating PHP from scratch. Their encryption package is at a glance the most advanced software of these three. One drawback is that the running server must run Zend Optimizer in order to parse the encoded scripts, although Zend Optimizer is free for download by anyone.

Let's go Open Source, shall we?

These are all well established commercial programs. This means that in order to protect your product, you need to buy third party software. Luckily there is an option. Say hello to Open Source software!
Open Source means that anyone can view modify and contribute to a program in development. The main benefit for a lone programmer is that it's completely free of charge and can be used to solve this PHP encryption issue.
There is one thing that separates all of these programs. Type One is the programs that needs to have additional software installed on the hosting server in order for it to run. This means that the administrator (most often not you) will have to modify something on the server where the encrypted files will be executed. In turn, this means an additional layer of time consuming stuff when distributing your software. Sometimes this is okay, but most often not.
Type Two is the programs that doesn't need to have additional software installed on the server. PHP Obfuscator falls into this category. Theoretically it is possible to have a higher level of security (and sometimes performance) when using Type One encrypters. In practice, noone will ever put that much effort into trying to reverse engineer your scripts. This is why we chose PHP Obfuscator for this How-To part.
Here are two of the main Open Source PHP encryption tools:

Turck MMCache for PHP

Turck MMCache is an open source software package with many included features, such as PHP accelerator, optimizer, encoder and dynamic content cache. One drawback is that in order to use all these functions you need to have additional software installed on the running server. It is fully compatible with Zend Optimizer, but not recommended.

PHP Obfuscator (POBS)

This is the software package focused on in this arcicle. It does not need additional server PHP modules installed in order to run. It's easy to install and easy to use. The main feature is the actual PHP encryption, with many configuration options. The PHP Obfuscator is available for download from their home page.

How To install POBS

First you need to download it. This is easily done from the home page (see link above). The software is distributed in a .zip file. Just save it to your desktop and open it up. Qouting the INSTALL instructions for POBS:
"Installing POBS is as easy as I could think of. Just unzip the downloaded file and put it a directory that is located under your webserver. POBS is a collection of files in just 1 directory."
Easy as pie! Now, since POBS is itself written using PHP, you need a web server to run the script. A tutorial for installing a web server is easy to find using a favourite web search engine of your choice. Now, let's assume the .zip file is unpacked and the POBS files are residing on your web server, for example in this directory: "c:\wwwroot\pobs".

How To use POBS

Using a favourite web browser of your choice, navigate to your new POBS directory. E.g:"http://www.mysite.com/pobs". When using your local computer, use "localhost" instead of"www.mysite.com". You will be presented with a nice POBS interface screen. Blue and purple/gray seems to be the chosen theme for this program. There are several options consisting of both textboxes and checkboxes. The default values are fine but can be changed as the user (YOU) sees fit. Feel free to experiment with the options. No harm can be done since the program will not run unless source and target directories are different.

How To configure POBS

Let's have a look at the options:
  • TimeOut (sec) - This option is not editable. It is read from your PHP configuration and is meant as a safety measure in order to let the web server encrypt the files until it is done. If this value is too small, the encryption will be stopped half way. This might happen if the PHP configuration is set to safe mode, but is often easy to remedy. The default of 5000 secs is fine.
  • Source Directory - is the local directory where the PHP files to be encrypted are stored. Note that this is not a "http://" address, but rather a "c:/wwwroot/php" address. One thing to be careful of is the use of"/" instead of "\". An ordinary local address "c:\wwwroot" is written "c:/wwwroot".
  • Target Directory - is, of course, the directory where you want the encrypted files to end up. The same rules as source directory apply here.
  • Replacements - Here is the good stuff. Checking or unchecking these boxes means that a type of conversion is to be made or not to be made. For example, the "variables" option means that the PHP variables will be substituted with garbage characters, to obfuscate the code and ruin the readability. The more you choose, the better is the encryption. Note that some options might make the code invalid! If any problems occur, try unchecking the boxes one by one until usable code is produced. Avoid that checkbox and everything should work fine.
  • Removals - The same principle works here. Mark the boxes in order to further obfuscate the code.
  • File System - Here are some vital options.
  • Replace edited files only - means that only the encrypted PHP files will be transferred to the target directory.
  • Recursive scan - The whole directory tree, including subdirectories of your source directory will be processed. Very useful for encrypting entire web sites.
  • Copy all files - Marking this checkbox will make POBS copy all the files in the source directory. Pictures, stylesheets, animations, movies. Everything will end up in the new directory. This is perfect for making the new encrypted PHP site easily integrated into the live environment.
  • Copyright Text - Well, since you are making the code closed source, you might as well include a copyright notice. This notice will be readable to the naked eye and hopefully deter any reverse engineering attempts.

How To start the machine

You're ready to go! Click the "Start Processing" button in the bottom of the page. POBS will commence encryption according to your options. This might take a while. Take a break, read the magazine, drink a cup of hot coco and it will be finished when you return.
The final page that POBS shows it the status report. This is a very detailed page displaying everything that has happened and what files that has been processed. Take a few minutes going though this page and check if it looks alright.

You're done

Yep, that was it. You have encrypted the PHP files and can distribute and/or sell your software without any concerns about copyright violations. Well done!













Encrypt Passwords in the Database

Written By Unknown on Sabtu, 13 Maret 2010 | 00.15


If you are developing a password-protected web site, you have to make a decision about how to store user password information securely.

What is "secure," anyway? Realize that the data in your database is not safe. What if the password to the database is compromised? Then your entire user password database will be compromised as well. Even if you are quite certain of the security of your database, your users' passwords are still accessible to all administrators who work at the Web hosting company where your database is hosted. Scrambling the passwords using some home-brewed algorithm may add some obscurity but not true "security." Another approach would be to encrypt all passwords in your database using some industry-standard cipher, such as the Message-Digest Algorithm 5 (MD5).
MD5 encryption is a one-way hashing algorithm. Two important properties of the MD5 algorithm are that it is impossible to revert back an encrypted output to the initial, plain-text input, and that any given input always maps to the same encrypted value. This ensures that the passwords stored on the server cannot be deciphered by anyone. This way, even if an attacker gains reading permission to the user table, it will do him no good.
MD5 does have its weaknesses. MD5 encryption is not infallible: if the password is not strong enough, a brute force attack can still reveal it. So, you can ask: "Why should I use MD5 if I know it is not the most secure?" The answer is fairly straightforward: it's fast, it's easy, and it can be powerful if salted. The greatest advantage of MD5 is its speed and ease of use.
It is vitally important to understand that password encryption will not protect your website, it can protect your passwords only. If your website does not have sufficient protection, password encryption will not make it safe from cracking. If your system has been cracked, a hacker can inflict a irreparable damage to it and also gain an access to confidential information, including passwords database. But if you store this information encrypted, hackers practically cannot make use of it. Cracking an encrypted password takes a large amount of time and processing power, even on today's computers.
So, let's start. First of all, you need to add a new account to your database. The following code allows to do it.
<?php
define("DB_SERVER", "localhost");
define("DB_USER", "your_name");
define("DB_PASS", "your_pass");
define("DB_NAME", "your_db");
define("TBL_USERS", "users_table_name");

$connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME, $connection) or die(mysql_error());

...

function addNewUser($username, $password){
   global $connection;
   $password = md5($password);
   $q = "INSERT INTO ".TBL_USERS." VALUES ('$username', '$password')";
   return mysql_query($q, $connection);
}
?>

Now, when a new user completes the registration form, his password will be encrypted automatically.
After that we should write code that validates a given username/password pair.
<?php
function checkUserPass($username, $password){
   global $connection;
     
   $username = str_replace("'","''",$username)
   $password = md5($password);
   // Verify that user is in database
   $q = "SELECT password FROM ".TBL_USERS." WHERE username = '$username'";
   $result = mysql_query($q, $connection);
   if(!$result || (mysql_numrows($result) < 1)){
     return 1; //Indicates username failure
   }     
   
   // Retrieve password from result
   $dbarray = mysql_fetch_array($result);
   
   // Validate that password is correct
   if($password == $dbarray['password']){
      return 0; 
//Success! Username and password confirmed
   }
   else{
      return 1; 
//Indicates password failure
   }
}
?>

And what if you already have users' database ready and want to start using encrypted passwords? To do it, you need to write encypt.php script with the following code and run it in your browser.
<?php
define("DB_SERVER", "localhost");
define("DB_USER", "your_name");
define("DB_PASS", "your_pass");
define("DB_NAME", "your_db");
define("TBL_USERS", "users_table_name");
define("FLD_USER", "username_field_name");
define("FLD_PASS", "password_field_name");

set_magic_quotes_runtime(0);

$connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME, $connection) or die(mysql_error());

$q = "SELECT ".FLD_PASS.",".FLD_USER." FROM ".TBL_USERS."";
$result = mysql_query($q, $connection);

$total=0;
$enc=0;

$doencrypt=false;
if (@$_REQUEST["do"]=="encrypt")
  $doencrypt=true;

while($data = mysql_fetch_array($result))
{
  if ($doencrypt)
  {
    $total++;
    if (!encrypted($data[0]))
    {
      $q="UPDATE ".TBL_USERS." SET ".FLD_PASS."='".md5($data[0])."' where ".FLD_USER."='".
      str_replace("'","''",$data[1])."'";
      mysql_query($q, $connection);
    }
   $enc++;
 }
 else
 {
   $total++;
   if (encrypted($data[0]))
     $enc++;
 }
}

function encrypted($str)
{
  if (strlen($str)!=32)
    return false;

  for($i=0;$i<32;$i++)
    if ((ord($str[$i])<ord('0') || ord($str[$i])>ord('9')) && (ord($str[$i])<ord('a') || ord($str[$i])>ord('f')))
     return false;

return true;
}
?>

<html>
<head><title>Encrypt passwords</title></head>
<body>
Total passwords in the table - <?php echo $total; ?><br>
<?php if($enc==$total && $total>0) { ?>
All passwords are encrypted.
<?php } else if($total>0) { ?>
Unencrypted - <?php echo $total-$enc; ?><br><br>
Click "GO" to encrypt <?php echo $total-$enc; ?> passwords.<br>
WARNING! There will be no way to decipher the passwords.<br>
<input type=button value="GO" onclick="window.location='encrypt.php?do=encrypt';">
<?php } ?>
</body>
</html>
 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger