Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41dc18673c | ||
|
|
0c7eecb97d | ||
|
|
9c80f13748 | ||
|
|
5a28e37998 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "commands",
|
||||
"version": "0.2.9",
|
||||
"version": "0.2.10",
|
||||
"description": "CLI y migraciones para Duckbrain",
|
||||
"components": {
|
||||
"cli": {
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Toolbox;
|
||||
*/
|
||||
final class Config
|
||||
{
|
||||
public const VERSION = '0.2.9';
|
||||
public const VERSION = '0.2.10';
|
||||
|
||||
public static function toolboxUrl(): string
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "crypto",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"description": "Criptograf\u00eda y segundo factor (Crypto, Nonce, TwoFactorAuthenticator)",
|
||||
"core": {
|
||||
"requires": ">=0.1",
|
||||
|
||||
@@ -41,6 +41,10 @@ class Crypto
|
||||
*/
|
||||
public static function decryptHex(string $data, string $password = PRIVATE_KEY): string
|
||||
{
|
||||
if ($data === '' || !ctype_xdigit($data) || strlen($data) % 2 !== 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return static::decrypt(hex2bin($data), $password);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,10 @@ class Nonce
|
||||
*/
|
||||
public static function check(string $nonce, string $passphrase = ''): bool
|
||||
{
|
||||
if ($nonce === '' || !ctype_xdigit($nonce) || strlen($nonce) % 2 !== 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$decripted = openssl_decrypt(
|
||||
hex2bin($nonce),
|
||||
'aes-128-ecb',
|
||||
|
||||
Reference in New Issue
Block a user