Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Obimydudee authored Jun 10, 2024
0 parents commit dc4cf29
Show file tree
Hide file tree
Showing 6 changed files with 272 additions and 0 deletions.
25 changes: 25 additions & 0 deletions VX0r.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33530.505
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VX0r", "VX0r\VX0r.csproj", "{D7EE2FAD-2E8A-4416-8900-40E88162E68F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D7EE2FAD-2E8A-4416-8900-40E88162E68F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7EE2FAD-2E8A-4416-8900-40E88162E68F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7EE2FAD-2E8A-4416-8900-40E88162E68F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7EE2FAD-2E8A-4416-8900-40E88162E68F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7699C4E0-0A29-4776-87DC-FA9CBBD916C5}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions VX0r/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
98 changes: 98 additions & 0 deletions VX0r/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
using System;

namespace VX0r
{
internal class Program
{
public static utils _utils = new utils();
static void Main(string[] args)
{
string[] array = new string[]
{
"Xor Encode", "Xor Decode", "Exit"
};

int num = 0;
while (true)
{
Console.Title = "| VX0R |";
Console.Clear();
for (int j = 0; j < array.Length; j++)
{
if (j == num)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("> ");
Console.ForegroundColor = ConsoleColor.White;
}
else
{
Console.Write(" ");
}
Console.WriteLine(array[j]);
Console.ForegroundColor = ConsoleColor.White;
}
switch (System.Console.ReadKey().Key)
{
case ConsoleKey.UpArrow:
if (num > 0)
{
num--;
System.Console.WriteLine(num);
}
break;
case ConsoleKey.DownArrow:
if (num < array.Length - 1)
{
num++;
System.Console.WriteLine(num);
}
break;
case ConsoleKey.Enter:
if (num == array.Length - 1)
{
System.Console.WriteLine("Exiting program.");
return;
}
switch (num)
{
case 0:
XorEnc();
break;
case 1:
XorDec();
break;
default:
break;
}
break;
}
}
}

public static void XorDec()
{
Console.Clear();
Console.Write("Enter XorHexed string: ");
string inp = Console.ReadLine();
Console.Clear();
Console.Write("Enter key: ");
string key = Console.ReadLine();
Console.WriteLine($"\n{_utils.Dec(inp, key)}");
Console.ReadKey();
}

public static void XorEnc()
{
Console.Clear();
Console.Write("Enter string: ");
string inp = Console.ReadLine();
Console.Clear();
Console.Write("Enter key: ");
string key = Console.ReadLine();
Console.WriteLine($"\n{_utils.Enc(inp, key)}");
Console.ReadKey();
}

}
}
36 changes: 36 additions & 0 deletions VX0r/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("VX0r")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VX0r")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d7ee2fad-2e8a-4416-8900-40e88162e68f")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
55 changes: 55 additions & 0 deletions VX0r/VX0r.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D7EE2FAD-2E8A-4416-8900-40E88162E68F}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>VX0r</RootNamespace>
<AssemblyName>VX0R</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="utils.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
52 changes: 52 additions & 0 deletions VX0r/utils.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using System.Linq;
using System.Text;

namespace VX0r
{
internal class utils
{
public utils() { }

public string FromHex(string hex)
{
byte[] raw = new byte[hex.Length / 2];
for (int i = 0; i < raw.Length; i++)
{
raw[i] = Convert.ToByte(hex.Substring(i * 2, 2), 16);
}
byte[] anon = raw;
string slin = Encoding.ASCII.GetString(anon, 0, anon.Length);

return slin;
}

public string Enc(string plaintext, string pad)
{
char[] data = plaintext.ToCharArray();
char[] key = pad.ToCharArray();

for (int i = 0; i < data.Length; i++)
{
data[i] = (char)(data[i] ^ key[i % key.Length]);
}
return bytes(new string(data));
}

public string Dec(string enctext, string pad)
{
var data = FromHex(enctext);
char[] key = pad.ToCharArray();
return Encoding.UTF8.GetString(data.Select((b, i) => (byte)(b ^ key[i % key.Length])).ToArray());
}

public string bytes(string inse)
{
string decString = inse;
byte[] bytes = Encoding.Default.GetBytes(decString);
string hexString = BitConverter.ToString(bytes);
hexString = hexString.Replace("-", "");
return hexString.ToLower();
}
}
}

0 comments on commit dc4cf29

Please sign in to comment.