encryption

Problem with MySQL's AES_DECRYPT

偶尔善良 提交于 2020-01-24 19:36:12
问题 I'm looking for a way to encrypt data on its way into a MySQL database, and decrypt it on the way out. Additionally, I would like to be able to perform normal SQL queries on those fields, such as searching and comparison, which prevents me from using a pure PHP solution. This leads me to AES_ENCRYPT() and AES_DECRYPT(), which can be duplicated in PHP using MCRYPT. I'm having a hard time with AES_DECRYPT and have tried all suggestions I can find through searches online. Here's my table: CREATE

in Laravel. How to encrypt email adress in user table

荒凉一梦 提交于 2020-01-24 19:32:07
问题 I want to encrypt email adress in user table because protect personal information. I try this way app¥Encryptable.php <?php namespace App; use Crypt; trait Encryptable{ public function getAttribute($key){ $value = parent::getAttribute($key); if (in_array($key, $this->encryptable)) {$value = Crypt::decrypt($value);return $value;} return $value; } public function setAttribute($key, $value){ if (in_array($key, $this->encryptable)) {$value = Crypt::encrypt($value);} return parent::setAttribute(

Simple Affine Cipher Encrpytion Decryption

我只是一个虾纸丫 提交于 2020-01-24 18:55:06
问题 I am writing two functions that encrypt and decrypt messages using an affine cipher. For some reason, my encryption and decryption are off by a few letters. I feel the issue is related to the ASCII numbers not matching the a=0, z=25 format. Could someone please help me figure out what's going on? Cleopatra should encrypt to whkcjilxi , MZDVEZC should decrypt to anthony But instead, I'm getting Cleopatra = ZKNFMLOAL and MZDVEZC = NAGUBAL . main function: int main() { plaintext = "cleopatra";

Linux libcrypto AES-128 CBC Encryption/Decryption works on Ubuntu but not Raspberry Pi

僤鯓⒐⒋嵵緔 提交于 2020-01-24 17:05:05
问题 The following example encrypts and decrypts to the same original string properly on a 64-bit Desktop Ubuntu 16.04, but when the same code is compiled and run on Raspberry Pi ( ARM ) ( and also another custom Linux ARM board ) it fails to decrypt to the original string. Both the Raspberry Pi and the other ARM board decrypt to the same, but incorrect, value. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <openssl/aes.h> #include <openssl/crypto.h> /* AES key for Encryption

Bouncy castle no such method error

余生长醉 提交于 2020-01-24 13:05:33
问题 I'm trying to decrypt a file using Bouncy Castle v1.53 PGP and Using PGPUtil class. The program works fine in my Eclipse, but given following error when integrated inside a war file and deployed onto a weblogic server.I'm using following dependencies: 1)bcpg-jdk15on 2)bcprov-jdk15on Error java.lang.NoSuchMethodError: org.bouncycastle.util.Strings.newList()Lorg/bouncycastle/util/StringList; at org.bouncycastle.bcpg.ArmoredInputStream.<init>(Unknown Source) at org.bouncycastle.bcpg

Purpose of going for an Azure Key Vault storage

我只是一个虾纸丫 提交于 2020-01-24 09:51:05
问题 I'm new to azure cloud services platform. Today i came across the Key-Vault storage service provided by azure. It has the ability to store application level keys and settings. It is safe and secure with enhanced data protection. But what i'm not clearly getting is to connect to Key-Vault i need the artifacts of my Key-Vault stored in my application config. If that is the case when someone eves-drop on the key values will he not connect to my Key-Vault and read all my keys. If I should encrypt

PHP Gnupg is not showing up as an extension in phpinfo() and I can't use it in php

别等时光非礼了梦想. 提交于 2020-01-24 00:45:09
问题 I have gnupg and gpgme installed using homebrew. I also linked both and made sure they are installed and linked by running brew gnupg install and brew gpgme install and got the message confirming the installation and the version. I have placed the gnupg.so file in the extension path and also added extension=gnupg.so into the php.ini file. I got the extension path and the specific php.ini's path from the infophp page. After restarting mamp, I still don't see gnupg or gpgme as extensions on

PHP decryption with mcrypt returns unintelligible text instead of original plaintext

跟風遠走 提交于 2020-01-23 19:25:15
问题 I am just trying to encrypt and decrypt a string. But when I output the decrypted string I only get: �� ^����V��_��n�.ZZ��Ǐ��:�2�� My code: function encrypt($string, $secret_key = "ATRTHTRAGSFRSGTS") { $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); return mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $secret_key, $string, MCRYPT_MODE_CBC, $iv); } function decrypt($string, $secret_key = "ATRTHTRAGSFRSGTS") { $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT

PHP decryption with mcrypt returns unintelligible text instead of original plaintext

馋奶兔 提交于 2020-01-23 19:23:37
问题 I am just trying to encrypt and decrypt a string. But when I output the decrypted string I only get: �� ^����V��_��n�.ZZ��Ǐ��:�2�� My code: function encrypt($string, $secret_key = "ATRTHTRAGSFRSGTS") { $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); return mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $secret_key, $string, MCRYPT_MODE_CBC, $iv); } function decrypt($string, $secret_key = "ATRTHTRAGSFRSGTS") { $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT

Send encrypted file (zip or txt) - via PHP - openable on Windows PC

房东的猫 提交于 2020-01-23 18:26:48
问题 I have a need to send some minimal data via email to users (but it must be encrypted). They would need to DL the attachment and decrypt it with some kind of easy to use software (PC / MAC)... any ideas here? My first thought is to make an encrypted zip file that they can open with 7zip or winzip... but I have found that it can't happen with a typical PHP/Linux app. 回答1: You can use mcrypt and Blowfish to encrypt message. You can find many encrypt/decrypt programs for Blowfish eg... http://www