Encryption

Encryption

Configuration

Before using Nova‘s encrypter, you should set the ENCRYPT_KEY option of your app/Config.php configuration file to a 32 character, random string. If this value is not properly set, all values encrypted by Nova will be insecure.

For an easy way to set an encryption key, navigate to your project directory and use php nova make:key in your console/terminal.

Basic Usage

Encrypting a value

You may encrypt a value using the Crypt facade. All encrypted values are encrypted using OpenSSL and the AES-256-CBC cipher. Furthermore, all encrypted values are signed with a message authentication code (MAC) to detect any modifications to the encrypted string.

use Crypt;

Crypt::encrypt($secret);

Decrypting a value

Of course, you may decrypt values using the decrypt method on the Crypt facade. If the value can not be properly decrypted, such as when the MAC is invalid, an Encryption\DecryptException will be thrown:

use Crypt;
use Encryption\DecryptException;

try {
    $decrypted = Crypt::decrypt($encryptedValue);
} catch (DecryptException $e) {
    //
}
时间: 2024-10-14 13:57:26

Encryption的相关文章

backup, file manipulation operations (such as ALTER DATABASE ADD FILE) and encryption changes on a database must be serialized.

昨天在检查YourSQLDba备份时,发现有台数据库做备份时出现了下面错误信息,如下所示: <Exec>   <ctx>yMaint.ShrinkLog</ctx>   <inf>Log Shrink</inf>   <Sql> --  ======================================================================== -- Shrink of log file E:\SQ

十三:Transparent Encryption in HDFS(转)

透明加密:http://blog.csdn.net/linlinv3/article/details/44963429 hadoop透明加密  kms 简介 Hadoop Key Management Server(KMS)是一个基于HadoopKeyProvider API编写的密钥管理服务器.他提供了一个client和一个server组件,client和server之间基于HTTP协议使用REST API通信.Client是一个KeyProvider的实现,使用KMS HTTP REST A

[JavaSecurity] - RSA Encryption

1. RSA Algorithm RSA is one of the first practical public-key cryptosystems and is widely used for secure data transmission. In such a cryptosystem, the encryption key (public key) is public and differs from the decryption key (private key) which is

AES advanced encryption standard 3

This optimized <../aesbench/> AES implementation conforms to FIPS-197. aes.h #ifndef _AES_H #define _AES_H #ifndef uint8 #define uint8 unsigned char #endif #ifndef uint32 #define uint32 unsigned long int #endif typedef struct { uint32 erk[64]; /* en

AES advanced encryption standard 2

/* * FIPS-197 compliant AES implementation * * Copyright (C) 2006-2007 Christophe Devine * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redi

HNU 12888 Encryption(map容器)

题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12890&courseid=274 解题报告:输入一个有n个单词的句子,然后再输入这n个单词对应的意思是什么,要你翻译出这个句子最后是什么. 一个裸的map 1 #include<cstdio> 2 #include<cstring> 3 #include<iostream> 4 #include<algorithm>

Unique Encryption Keys (思维题 预处理)

题目 题意:给m个数字, q次询问, 询问b到e之间如果有重复数字就输出, 没有就输出OK 思路:用f[i]数组 记录从i开始向后最近的有重复数字的 位置, 如 1 3 2 2, 则f[1] = 4; 如果离a最近的重复数字的位置 都大于b, 就说明没有重复数字. f[]数组需要预处理,从后向前. 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <vector>

【Consul】Consul实践指导-Encryption配置

Consul Agent支持对其所有的网络数据流进行加密.加密方法后续介绍.有两个独立的加密系统:Gossip Traffic和RPC. 1.1.1 Gossip Encryption 启用Gossip加密方式,只需要在启动Agent时设置加密密钥.通过encrypt参数设置密钥:设置的值是包含密钥的配置文件. Key值必须是16字节,基于base64编码.为方便起见,Consul提供consul keygen命令来生成满足要求的加密密钥: $ consul keygen cg8StVXbQJ0

hihoCoder #1240 Image Encryption

Description A fancy square image encryption algorithm works as follow: 0. consider the image as an N x N matrix 1. choose an integer k∈ {0, 1, 2, 3} 2. rotate the square image k * 90 degree clockwise 3. if N is odd stop the encryption process 4. if N

AES advanced encryption standard

// advanced encryption standard // author: karl malbrain, [email protected] typedef unsigned char uchar; #include <string.h> #include <memory.h> // AES only supports Nb=4 #define Nb 4 // number of columns in the state & expanded key #defin