Skip to content

linkomnia/Crypt-Fernet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypt-Fernet version 0.01
=========================

Fernet (symmetric encryption)

Fernet provides guarantees that a message encrypted using it cannot be manipulated or read without the key. Fernet is an implementation of symmetric (also known as “secret key”) authenticated cryptography. 
This is the Perl Implementation

More Detail:
   https://github.com/fernet/spec/blob/master/Spec.md

EXAMPLES

   my $key = Crypt::Fernet::generate_key();
   my $plaintext = 'This is a test';
   my $token = Crypt::Fernet::encrypt($key, $plaintext);
   my $verify = Crypt::Fernet::verify($key, $token);
   my $decrypttext = Crypt::Fernet::decrypt($key, $token);

   my $old_key = 'cJ3Fw3ehXqef-Vqi-U8YDcJtz8Gv-ZHyxultoAGHi4c=';
   my $old_token = 'gAAAAABT8bVcdaked9SPOkuQ77KsfkcoG9GvuU4SVWuMa3ewrxpQdreLdCT6cc7rdqkavhyLgqZC41dW2vwZJAHLYllwBmjgdQ==';

   my $ttl = 10;
   my $old_verify = Crypt::Fernet::verify($old_key, $old_token, $ttl);
   my $old_decrypttext = Crypt::Fernet::decrypt($old_key, $old_token, $ttl);

   my $ttl_verify = Crypt::Fernet::verify($key, $token, $ttl);
   my $ttl_decrypttext = Crypt::Fernet::decrypt($key, $token, $ttl);


INSTALLATION

To install this module type the following:

   perl Makefile.PL
   make
   make test
   make install

DEPENDENCIES

This module requires these other modules and libraries:

  use Crypt::CBC;
  use Digest::SHA qw(hmac_sha256);
  use MIME::Base64::URLSafe;

COPYRIGHT AND LICENCE

Put the correct copyright and licence information here.

Copyright (C) 2014 by LinkOmnia Ltd (wanleung@linkomnia.com)

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.18.2 or,
at your option, any later version of Perl 5 you may have available.


About

Fernet (symmetric encryption) perl library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Perl 100.0%