Git Product home page Git Product logo

teacrypt's Introduction

Teacrypt

Encryption solution

Keunggulan Teacrypt

  • Proses enkripsi menggunakan salt. Sehingga hasil enkripsi selalu berbeda walaupun dengan key yang sama.
  • Hasil enkripsi dicompress dengan gzdeflate.
  • Hasil compress akan diencode dengan base64. Sehingga hasil return akhir selalu printable.
  • Hasil dekripsi selalu sama seperti semula jika didekripsi dengan key yang sama.

Contoh

<?php
require __DIR__ . '/vendor/autoload.php';
use Teacrypt\Teacrypt;

$string = "hello world";
$key    = "redangel";
$encrypted_string1 = Teacrypt::encrypt($string, $key);
$decrypted_string2 = Teacrypt::decrypt($encrypted_string1, $key);

$encrypted_string2 = Teacrypt::encrypt($string, $key);
$decrypted_string2 = Teacrypt::decrypt($encrypted_string2, $key);

var_dump(array(
        "hasil kesamaan enkripsi 1 dan 2" => ($encrypted_string1 == $encrypted_string2),
        "encrypted_string" => array($encrypted_string1, $encrypted_string2),
        "decrypted_string" => array($decrypted_string2, $decrypted_string2)
    ));

Akan menghasilkan

array(3) {
  ["hasil kesamaan enkripsi 1 dan 2"]=>
  bool(false)
  ["encrypted_string"]=>
  array(2) {
    [0]=>
    string(24) "LikCOgUyUFLUmnwMlHXlmLAA"
    [1]=>
    string(24) "rUjyKKDi3WLS3zadlPndULAA"
  }
  ["decrypted_string"]=>
  array(2) {
    [0]=>
    string(11) "hello world"
    [1]=>
    string(11) "hello world"
  }
}

Installation

Add composer.json

{
	"require": {
		"ammarfaizi2/teacrypt": "1.4"
	}
}

teacrypt's People

Contributors

ammarfaizi2 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.