$Base64Data = "BASE64_SZÖVEG"
$Password = "JELSZÓ"
try {
$EncryptedBytes = [Convert]::FromBase64String($Base64Data)
$Key = (New-Object System.Security.Cryptography.SHA256Managed).ComputeHash([Text.Encoding]::UTF8.GetBytes($Password))
$AES = New-Object System.Security.Cryptography.AesManaged
$AES.Mode = [System.Security.Cryptography.CipherMode]::CBC
$AES.Padding = [System.Security.Cryptography.PaddingMode]::PKCS7
$AES.Key = $Key
$IV = $EncryptedBytes[0..15]
$CipherText = $EncryptedBytes[16..($EncryptedBytes.Length - 1)]
$AES.IV = $IV
$Decryptor = $AES.CreateDecryptor()
$DecryptedBytes = $Decryptor.TransformFinalBlock($CipherText, 0, $CipherText.Length)
$DecryptedText = [Text.Encoding]::UTF8.GetString($DecryptedBytes)
Write-Output "Dekódolt szöveg:"
Write-Output $DecryptedText
}
catch {
Write-Error "Hiba történt a dekódolás során: $_"
}
- timi blogja
- A hozzászóláshoz be kell jelentkezni
- 539 megtekintés