I dont understand why i can generate PGP keys and also encrypt it with GnuPG v1 but not in my Laravel Script:
Controller:
$user_details = User::where('username',$user_name)->first();
$secret = $this->generateSecretKey();
$secret_hash = password_hash($secret, PASSWORD_BCRYPT);
$this->secret_code = $secret_hash;
//echo $user_details->pgp;
putenv("GNUPGHOME =/home/.gnupg");
$gpg = new gnupg();
$key = $gpg->import($user_details->pgp);
$gpg->addencryptkey($key['fingerprint']);
$enc = $gpg->encrypt($secret);
$gpg->clearencryptkeys();
//echo '<textarea rows="30" class="form-control" name="pgp-msg">'.$enc.'</textarea>';
My blade:
<textarea name="message" id="message" class="form-control" rows="15" cols="40" readonly></textarea>
Text field is empty.
Must i echo or Print $enc on other way?
Gnupg is installed and i can enrypt in Terminal keys.
Thanks
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire