set "bmpFile=woman.bmp" set "bmpFileOut=woman_ENC.bmp" powershell -Command "Get-Content %bmpFile% -Encoding byte -head 54 | Set-Content %bmpFile%.head -Encoding byte;Get-Content %bmpFile% -Raw -Encoding Byte | %% { $_[54 ..($_.Length-1)] } | Set-Content %bmpFile%.bin -Encoding byte;Add-Type -AssemblyName System.Security;$aesManaged = New-Object System.Security.Cryptography.AesCryptoServiceProvider;$aesManaged.Mode = [System.Security.Cryptography.CipherMode]::ECB;$aesManaged.GenerateKey();$aesManaged.GenerateIV();[System.IO.File]::WriteAllBytes('.\key.bin', $aesManaged.Key);[System.IO.File]::WriteAllBytes('.\IV.bin', $aesManaged.IV);$content= [IO.File]::ReadAllBytes('%bmpFile%.BIN');$encryptor = $aesManaged.CreateEncryptor($aesManaged.Key, $aesManaged.IV);$encryptedContent = $encryptor.TransformFinalBlock($content, 0, $content.Length);[System.IO.File]::WriteAllBytes('%bmpFile%.enc', $encryptedContent);"; && type NUL > %bmpFileOut% && @for %%x in (%bmpFile%.head, %bmpFile%.enc) do @copy /b %bmpFileOut%+"%%x" > nul del %bmpFile%.head del %bmpFile%.enc del %bmpFile%.bin