PHP Classes

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

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 58%Total: 335 All time: 7,107 This week: 455Up
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: United States United States
Age: 26
All time rank: 60981 in United States United States
Week rank: 22 Up4 in United States United States 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 (4)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:335
This week:0
All time:7,107
This week:455Up
User Ratings User Comments (4)
 All time
Utility:83%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:-
Examples:79%StarStarStarStar
Tests:-
Videos:-
Overall:58%StarStarStar
Rank:1531
 
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