PHP Classes

HAB Encryption: Encrypt and decrypt a string with a given key

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (4)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 58%Total: 335 This week: 1All time: 7,106 This week: 560Up
Version License PHP version Categories
hab-encryption 1.0.6Freeware5PHP 5, Cryptography
Description 

Author

This class can encrypt and decrypt a string with a given key.

It takes a given string and encrypts it by adding the code of o the characters in the string with the codes of the key string.

The class can also do the opposite process by reverting to the original string using the same key.

It can also encode the result encrypted string with base64 and store it on a file.

Picture of Haseeb Ahmad Basil
  Performance   Level  
Name: Haseeb Ahmad Basil is available for providing paid consulting. Contact Haseeb Ahmad Basil .
Classes: 11 packages by
Country: Pakistan Pakistan
Age: 26
All time rank: 6147 in Pakistan Pakistan
Week rank: 34 Up1 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 4x

Winner: 1x

Recommendations

What is the best PHP encrypt decrypt classes class?
Secure Encryption and Decryption of classes

Example

<?php

include "habEncrypt.php";

$has = new habEncrypt();

$string = 'Lorem Ipsum doller Sit';
$key = "123456789";
$enc = $has->enc($string, $key);
$dec = $has->dec($enc, $key);

var_dump("Integer only Key. encrypted Value: \"$enc\". Original and decrypted Value: \"$dec\"");

$key = "abc123def456";
$enc = $has->enc($string, $key);
$dec = $has->dec($enc, $key);

var_dump("String Key. encrypted Value: \"$enc\". Original and decrypted Value: \"$dec\"");


$key = "123456789";
$enc = $has->b64enc($string, $key);
$dec = $has->b64dec($enc, $key);

var_dump("Integer only Key(Base64 Version). encrypted Value: \"$enc\". Original and decrypted Value: \"$dec\"");

$key = "abc123def456";
$enc = $has->b64enc($string, $key);
$dec = $has->b64dec($enc, $key);

var_dump("String Key(Base64 Version). encrypted Value: \"$enc\". Original and decrypted Value: \"$dec\"");


$path = "dummy.jpg";
$key = "abc123def456";
$enc = $has->fileEnc($path, $key);
$dec = $has->dec($enc, $key);

//var_dump("String Key(Base64 Version). encrypted Value: \"$enc\". Original and decrypted Value: \"$dec\"");



  Files folder image Files  
File Role Description
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Image file dummy.jpg Data Auxiliary data
Accessible without login Plain text file example.php Example Example script
Plain text file habEncrypt.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:335
This week:1
All time:7,106
This week:560Up
User Ratings User Comments (4)
 All time
Utility:83%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:-
Examples:79%StarStarStarStar
Tests:-
Videos:-
Overall:58%StarStarStar
Rank:1514
 
Is poorly described as as such missleading The term "Encrypt...
6 years ago (Andy)
52%StarStarStar
Great Class
7 years ago (Rafiki)
70%StarStarStarStar
This is pretty good.
7 years ago (Mega sploder)
70%StarStarStarStar
Nice librery
7 years ago (muabshir)
70%StarStarStarStar