MalwareSourceCode/MSIL/Virus/Win32/E/Virus.Win32.Expiro.w-69bb73081eac86b8cf86f45e33515d0095855636967076e2b593d7a30cd80a07/Microsoft/InfoCards/TransformCryptoSession.cs

48 lines
1.6 KiB
C#
Raw Normal View History

2022-08-18 11:28:56 +00:00
// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.TransformCryptoSession
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 516D8B44-4448-4D2C-8B8E-FFBB3FFE472B
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Virus.Win32.Expiro.w-69bb73081eac86b8cf86f45e33515d0095855636967076e2b593d7a30cd80a07.exe
using System;
using System.Diagnostics;
using System.IO;
using System.Security.Cryptography;
using System.Security.Principal;
namespace Microsoft.InfoCards
{
internal class TransformCryptoSession : CryptoSession
{
private ICryptoTransform m_icrypto;
public TransformCryptoSession(
Process process,
DateTime expiration,
WindowsIdentity identity,
ICryptoTransform icrypto)
: base(process, expiration, identity, (object) icrypto, CryptoSession.SessionType.Transfrom)
{
this.m_icrypto = icrypto;
}
protected override void OnDispose() => this.m_icrypto.Dispose();
protected override void OnWrite(BinaryWriter bwriter)
{
bwriter.Write(this.m_icrypto.InputBlockSize);
bwriter.Write(this.m_icrypto.OutputBlockSize);
bwriter.Write(this.m_icrypto.CanTransformMultipleBlocks);
bwriter.Write(this.m_icrypto.CanReuseTransform);
}
public int TransformBlock(byte[] inData, out byte[] outData)
{
outData = new byte[this.m_icrypto.OutputBlockSize];
return this.m_icrypto.TransformBlock(inData, 0, inData.Length, outData, 0);
}
public byte[] TransformFinalBlock(byte[] inData) => this.m_icrypto.TransformFinalBlock(inData, 0, inData.Length);
}
}