AES Decryption
Decrypt an AES-256-GCM payload created by the iSocialize AES Encryption tool.
1000000) { throw new RuntimeException('Invalid encryption parameters.'); } $salt = base64_decode((string)($payload['salt'] ?? ''), true); $iv = base64_decode((string)($payload['iv'] ?? ''), true); $tag = base64_decode((string)($payload['tag'] ?? ''), true); $encrypted = base64_decode((string)($payload['data'] ?? ''), true); if ( $salt === false || $iv === false || $tag === false || $encrypted === false ) { throw new RuntimeException('Invalid encrypted payload.'); } $key = hash_pbkdf2( 'sha256', $password, $salt, $iterations, 32, true ); $decrypted = openssl_decrypt( $encrypted, 'aes-256-gcm', $key, OPENSSL_RAW_DATA, $iv, $tag ); if ($decrypted === false) { $error = 'Decryption failed. Check that the password and encrypted data are correct.'; } else { $result = $decrypted; } } catch (Throwable $e) { $error = 'Invalid encrypted data or incorrect password.'; } } } ?>
Decrypt an AES-256-GCM payload created by the iSocialize AES Encryption tool.