Pastebin

Paste #24082: No description

< previous paste - next paste>

Pasted by Anonymous Coward

Download View as text

using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v5.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("CfcsApp")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CfcsApp")]
[assembly: AssemblyTitle("CfcsApp")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace CfcsApp;

internal class Program
{
	private static string WordScrambler(Match match)
	{
		char[] array = new char[match.Value.Length];
		array[0] = match.Value[1];
		array[1] = match.Value[0];
		return new string(array);
	}

	private static void Main(string[] args)
	{
		MatchEvaluator evaluator = WordScrambler;
		Console.WriteLine("Please write your flag to make sure you got the right one");
		string text = Console.ReadLine();
		using AesManaged aesManaged = new AesManaged();
		ICryptoTransform transform = aesManaged.CreateEncryptor(Encoding.ASCII.GetBytes("cfcseretgodtsted"), new byte[16]);
		using MemoryStream memoryStream = new MemoryStream();
		using CryptoStream stream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Write);
		using (StreamWriter streamWriter = new StreamWriter(stream))
		{
			streamWriter.Write(text);
		}
		if (Regex.Replace(Convert.ToBase64String(memoryStream.ToArray()), "(.)(.)", evaluator) == "JdwW7xA6kHroHjibUXDFU6D5gJS+ndEOK/6+j5cWkC=k" || Convert.ToBase64String(Encoding.UTF8.GetBytes(text)) == "Q0ZDU3tSNG04MF9QNHJ0X0QzdXh9")
		{
			Console.WriteLine("You got the right password. You are great!");
			print(memoryStream)
		}
		else
		{
			Console.WriteLine("You did not get the right password. Please try again");
			print(memoryStream)

		}
	}
}

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.