GamerzPlanet - For All Your Online Gaming Needs!!

Go Back   GamerzPlanet - For All Your Online Gaming Needs!! > ijji Games > Gunz Online > Gunz Hacks/Bots Discussion

Gunz Hacks/Bots Discussion Gunz Hacks/Bots Discussion only. No begging.



This could help with .mef decryption.

Gunz Hacks/Bots Discussion


Reply
 
Thread Tools Display Modes
Old 08-23-2008, 09:46 PM   #1
Registered User
 
Xephyrok's Avatar
 
Last Online: Today 12:38 PM
Join Date: Mar 2008
Location: New Zealand
Posts: 252
Thanks: 3
Thanked 197 Times in 52 Posts
Xephyrok is on a distinguished road
iTrader: 0 / 0%
Points: 10,305.09
Bank: 0.00
Total Points: 10,305.09
This could help with .mef decryption.

Saw this on GzN, thought i could do the favour of posting it here for someone to make use of. (Not leeching)


How to: Decrypt XML Elements with Asymmetric Keys

Updated: November 2007

You can use the [Only registered and activated users can see links. ] in the System.Security.Cryptography.Xml namespace to encrypt and decrypt an element within an XML document. XML Encryption is a [Only registered and activated users can see links. ] way to exchange or store encrypted XML data, without worrying about the data being easily read. For more information about the XML Encryption [Only registered and activated users can see links. ], see the World Wide Web Consortium (W3C) specification for XML Encryption located at [Only registered and activated users can see links. ].

The example in this procedure decrypts an XML element that was encrypted using the methods described in: How to: Encrypt XML Elements with Asymmetric Keys. It finds an <EncryptedData> element, decrypts the element, and then replaces the element with the original plaintext XML element.

This example decrypts an XML element using two keys. It retrieves a previously generated RSA private key from a key container, and then uses the RSA key to decrypt a session key stored in the <EncryptedKey> element of the <EncryptedData> element. The example then uses the session key to decrypt the XML element.

This example is appropriate for situations where [Only registered and activated users can see links. ] applications need to share encrypted data or where an application needs to save encrypted data between the times that it [Only registered and activated users can see links. ].

To decrypt an XML element with an asymmetric key
1. Create a CspParameters object and specify the name of the key container.

Dim cspParams As New CspParameters()
cspParams.KeyContainerName = "XML_ENC_RSA_KEY"

CspParameters cspParams = new CspParameters();
cspParams.KeyContainerName = "XML_ENC_RSA_KEY";

2. Retrieve a previously generated asymmetric key from the container using the RSACryptoServiceProvider object. The key is automatically retrieved from the key container when you pass the CspParameters object to the constructor of the RSACryptoServiceProvider constructor.

Dim rsaKey As New RSACryptoServiceProvider(cspParams)

RSACryptoServiceProvider rsaKey = new RSACryptoServiceProvider(cspParams);

3. Create new EncryptedXml object to decrypt the document.
Dim xmlDoc As New XmlDocument()

' Load an XML file into the XmlDocument object.
Try
xmlDoc.PreserveWhitespace = True
xmlDoc.Load("test.xml")
Catch e As Exception
Console.WriteLine(e.Message)
End Try

XmlDocument xmlDoc = new XmlDocument();

// Load an XML file into the XmlDocument object.
try
{
xmlDoc.PreserveWhitespace = true;
xmlDoc.Load("test.xml");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}

XmlDocument xmlDoc = new XmlDocument();

// Load an XML file into the XmlDocument object.
try
{
xmlDoc.PreserveWhitespace = true;
xmlDoc.Load("test.xml");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}

4. Add a key/name mapping to associate the RSA key with the element within the document that should be decrypted. You must use the same name for the key that you used when you encrypted the document. Note that this name is separate from the name used to identify the key in the key container specified in step 1.

' Create a new EncryptedXml object.
Dim exml As New EncryptedXml(Doc)

// Create a new EncryptedXml object.
EncryptedXml exml = new EncryptedXml(Doc);

5. Call the DecryptDocument method to decrypt the <EncryptedData> element. This method uses the RSA key to decrypt the session key and automatically uses the session key to decrypt the XML element. It also automatically replaces the <EncryptedData> element with the original plaintext.
exml.AddKeyNameMapping(KeyName, Alg)

exml.AddKeyNameMapping(KeyName, Alg);

6. Save the XML document.

exml.DecryptDocument()

exml.DecryptDocument();

EXAMPLES

Imports System
Imports System.Xml
Imports System.Security.Cryptography
Imports System.Security.Cryptography.Xml



Module Program

Sub Main(ByVal args() As String)

' Create an XmlDocument object.
Dim xmlDoc As New XmlDocument()

' Load an XML file into the XmlDocument object.
Try
xmlDoc.PreserveWhitespace = True
xmlDoc.Load("test.xml")
Catch e As Exception
Console.WriteLine(e.Message)
End Try
Dim cspParams As New CspParameters()
cspParams.KeyContainerName = "XML_ENC_RSA_KEY"
' Get the RSA key from the key container. This key will decrypt
' a symmetric key that was imbedded in the XML document.
Dim rsaKey As New RSACryptoServiceProvider(cspParams)
Try

' Decrypt the elements.
Decrypt(xmlDoc, rsaKey, "rsaKey")

' Save the XML document.
xmlDoc.Save("test.xml")
' Display the encrypted XML to the console.
Console.WriteLine()
Console.WriteLine("Decrypted XML:")
Console.WriteLine()
Console.WriteLine(xmlDoc.OuterXml)
Catch e As Exception
Console.WriteLine(e.Message)
Finally
' Clear the RSA key.
rsaKey.Clear()
End Try


Console.ReadLine()

End Sub



Sub Decrypt(ByVal Doc As XmlDocument, ByVal Alg As RSA, ByVal KeyName As String)
' Check the arguments.
If Doc Is Nothing Then
Throw New ArgumentNullException("Doc")
End If
If Alg Is Nothing Then
Throw New ArgumentNullException("Alg")
End If
If KeyName Is Nothing Then
Throw New ArgumentNullException("KeyName")
End If
' Create a new EncryptedXml object.
Dim exml As New EncryptedXml(Doc)
' Add a key-name mapping.
' This method can only decrypt documents
' that present the specified key name.
exml.AddKeyNameMapping(KeyName, Alg)
' Decrypt the element.
exml.DecryptDocument()
End Sub
End Module
using System;
using System.Xml;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;

class Program
{
static void Main(string[] args)
{

// Create an XmlDocument object.
XmlDocument xmlDoc = new XmlDocument();

// Load an XML file into the XmlDocument object.
try
{
xmlDoc.PreserveWhitespace = true;
xmlDoc.Load("test.xml");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
CspParameters cspParams = new CspParameters();
cspParams.KeyContainerName = "XML_ENC_RSA_KEY";

// Get the RSA key from the key container. This key will decrypt
// a symmetric key that was imbedded in the XML document.
RSACryptoServiceProvider rsaKey = new RSACryptoServiceProvider(cspParams);

try
{

// Decrypt the elements.
Decrypt(xmlDoc, rsaKey, "rsaKey");

// Save the XML document.
xmlDoc.Save("test.xml");

// Display the encrypted XML to the console.
Console.WriteLine();
Console.WriteLine("Decrypted XML:");
Console.WriteLine();
Console.WriteLine(xmlDoc.OuterXml);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
finally
{
// Clear the RSA key.
rsaKey.Clear();
}


Console.ReadLine();


}

public static void Decrypt(XmlDocument Doc, RSA Alg, string KeyName)
{
// Check the arguments.
if (Doc == null)
throw new ArgumentNullException("Doc");
if (Alg == null)
throw new ArgumentNullException("Alg");
if (KeyName == null)
throw new ArgumentNullException("KeyName");
// Create a new EncryptedXml object.
EncryptedXml exml = new EncryptedXml(Doc);

// Add a key-name mapping.
// This method can only decrypt documents
// that present the specified key name.
exml.AddKeyNameMapping(KeyName, Alg);

// Decrypt the element.
exml.DecryptDocument();

}

}


To compile this example, you need to include a reference to System.Security.dll.

Include the following namespaces: System.Xml, System.Security.Cryptography, and System.Security.Cryptography.Xml.


How to: Encrypt XML Elements with Asymmetric Keys

Updated: November 2007

You can use the classes in the System.Security.Cryptography.Xml namespace to encrypt an element within an XML document. XML Encryption is a standard way to exchange or store encrypted XML data, without worrying about the data being easily read. For more information about the XML Encryption standard, see the World Wide Web Consortium (W3C) specification for XML Encryption located at [Only registered and activated users can see links. ].

You can use XML Encryption to replace any XML element or document with an <EncryptedData> element that contains the encrypted XML data. The <EncryptedData> element can also contain sub elements that include information about the keys and processes used during encryption. XML Encryption allows a document to contain multiple encrypted elements and allows an element to be encrypted multiple times. The code example in this procedure shows how to create an <EncryptedData> element along with several other sub elements that you can use later during decryption.

This example encrypts an XML element using two keys. It generates an RSA public/private key pair and saves the key pair to a secure key container. The example then creates a separate session key using the Advanced Encryption Standard (AES) algorithm, also called the Rijndael algorithm. The example uses the AES session key to encrypt the XML document and then uses the RSA public key to encrypt the AES session key. Finally, the example saves the encrypted AES session key and the encrypted XML data to the XML document within a new <EncryptedData> element.

To decrypt the XML element, you retrieve the RSA private key from the key container, use it to decrypt the session key, and then use the session key to decrypt the document. For more information about how to decrypt an XML element that was encrypted using this procedure, see How to: Decrypt XML Elements with Asymmetric Keys.

This example is appropriate for situations where multiple applications need to share encrypted data or where an application needs to save encrypted data between the times that it runs.

To encrypt an XML element with an asymmetric key
1. Create a CspParameters object and specify the name of the key container.


Dim cspParams As New CspParameters()
cspParams.KeyContainerName = "XML_ENC_RSA_KEY"

CspParameters cspParams = new CspParameters();
cspParams.KeyContainerName = "XML_ENC_RSA_KEY";

2. Generate a symmetric key using the RSACryptoServiceProvider class. The key is automatically saved to the key container when you pass the CspParameters object to the constructor of the RSACryptoServiceProvider class. This key will be used to encrypt the AES session key and can be retrieved later to decrypt it.

Dim rsaKey As New RSACryptoServiceProvider(cspParams)

Dim rsaKey As New RSACryptoServiceProvider(cspParams)

3. Create an XmlDocument object by loading an XML file from disk. The XmlDocument object contains the XML element to encrypt.

' Create an XmlDocument object.
Dim xmlDoc As New XmlDocument()

' Load an XML file into the XmlDocument object.
Try
xmlDoc.PreserveWhitespace = True
xmlDoc.Load("test.xml")
Catch e As Exception
Console.WriteLine(e.Message)
End Try

// Create an XmlDocument object.
XmlDocument xmlDoc = new XmlDocument();

// Load an XML file into the XmlDocument object.
try
{
xmlDoc.PreserveWhitespace = true;
xmlDoc.Load("test.xml");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
4. Find the specified element in the XmlDocument object and create a new XmlElement object to represent the element you want to encrypt. In this example, the "creditcard" element is encrypted.
Dim elementToEncrypt As XmlElement = Doc.GetElementsByTagName(ElementToEncryptName)(0)


' Throw an XmlException if the element was not found.
If elementToEncrypt Is Nothing Then
Throw New XmlException("The specified element was not found")
End If

XmlElement elementToEncrypt = Doc.GetElementsByTagName(ElementToEncrypt)[0] as XmlElement;

// Throw an XmlException if the element was not found.
if (elementToEncrypt == null)
{
throw new XmlException("The specified element was not found");

}

2. Create a new session key using the RijndaelManaged class. This key will encrypt the XML element, and then be encrypted itself and placed in the XML document.

' Create a 256 bit Rijndael key.
sessionKey = New RijndaelManaged()
sessionKey.KeySize = 256

// Create a 256 bit Rijndael key.
sessionKey = new RijndaelManaged();
sessionKey.KeySize = 256;

6. Create a new instance of the EncryptedXml class and use it to encrypt the specified element using the session key. The EncryptData method returns the encrypted element as an array of encrypted bytes.

Dim eXml As New EncryptedXml()

Dim encryptedElement As Byte() = eXml.EncryptData(elementToEncrypt, sessionKey, False)

EncryptedXml eXml = new EncryptedXml();

byte[] encryptedElement = eXml.EncryptData(elementToEncrypt, sessionKey, false);

7. Construct an EncryptedData object and populate it with the URL identifier of the encrypted XML element. This URL identifier lets a decrypting party know that the XML contains an encrypted element. You can use the XmlEncElementUrl field to specify the URL identifier. The plaintext XML element will be replaced by an <EncrypotedData> element encapsulated by this EncryptedData object.

Dim edElement As New EncryptedData()
edElement.Type = EncryptedXml.XmlEncElementUrl
edElement.Id = EncryptionElementID

EncryptedData edElement = new EncryptedData();
edElement.Type = EncryptedXml.XmlEncElementUrl;
edElement.Id = EncryptionElementID;

8. Create an EncryptionMethod object that is initialized to the URL identifier of the cryptographic algorithm used to generate the session key. Pass the EncryptionMethod object to the EncryptionMethod property.

edElement.EncryptionMethod = New EncryptionMethod(EncryptedXml.XmlEncAES256Url)

edElement.EncryptionMethod = new EncryptionMethod(EncryptedXml.XmlEncAES256Url);

9. Create an EncryptedKey object to contain the encrypted session key. Encrypt the session key, add it to the EncryptedKey object, and enter a session key name and key identifier URL.

Dim ek As New EncryptedKey()

Dim encryptedKey As Byte() = EncryptedXml.EncryptKey(sessionKey.Key, Alg, False)

ek.CipherData = New CipherData(encryptedKey)

ek.EncryptionMethod = New EncryptionMethod(EncryptedXml.XmlEncRSA15Url)

EncryptedKey ek = new EncryptedKey();

byte[] encryptedKey = EncryptedXml.EncryptKey(sessionKey.Key, Alg, false);

ek.CipherData = new CipherData(encryptedKey);

ek.EncryptionMethod = new EncryptionMethod(EncryptedXml.XmlEncRSA15Url);

10. Create a new DataReference object that maps the encrypted data to a particular session key. This optional step allows you to easily specify that multiple parts of an XML document were encrypted by a single key.

Dim dRef As New DataReference()

' Specify the EncryptedData URI.
dRef.Uri = "#" + EncryptionElementID

' Add the DataReference to the EncryptedKey.
ek.AddReference(dRef)

DataReference dRef = new DataReference();

// Specify the EncryptedData URI.
dRef.Uri = "#" + EncryptionElementID;

// Add the DataReference to the EncryptedKey.
ek.AddReference(dRef);

11. Add the encrypted key to the EncryptedData object.


edElement.KeyInfo.AddClause(New KeyInfoEncryptedKey(ek))

edElement.KeyInfo.AddClause(new KeyInfoEncryptedKey(ek));

12Create a new KeyInfo object to specify the name of the RSA key. Add it to the EncryptedData object. This helps the decrypting party identify the correct asymmetric key to use when decrypting the session key.
' Create a new KeyInfo element.
edElement.KeyInfo = New KeyInfo()

' Create a new KeyInfoName element.
Dim kin As New KeyInfoName()

' Specify a name for the key.
kin.Value = KeyName

' Add the KeyInfoName element to the
' EncryptedKey object.
ek.KeyInfo.AddClause(kin)

// Create a new KeyInfo element.
edElement.KeyInfo = new KeyInfo();

// Create a new KeyInfoName element.
KeyInfoName kin = new KeyInfoName();

// Specify a name for the key.
kin.Value = KeyName;

// Add the KeyInfoName element to the
// EncryptedKey object.
ek.KeyInfo.AddClause(kin);

For the rest go to this link im too lazy [Only registered and activated users can see links. ]

[Only registered and activated users can see links. ]

[Only registered and activated users can see links. ]

[Only registered and activated users can see links. ]
Xephyrok is offline   Reply With Quote
Sponsored Links
Old 08-23-2008, 09:52 PM   #2
Registered User
 
Last Online: 12-03-2008 06:49 AM
Join Date: Feb 2008
Location: Somewhere o.o
Posts: 120
Thanks: 46
Thanked 5 Times in 5 Posts
haloistaken101 is on a distinguished road
iTrader: 0 / 0%
Points: 14,844.67
Bank: 0.00
Total Points: 14,844.67
Re: This could help with .mef decryption.

WTF is all this shiet LOL im confused but im going to read it all and see if it helps =/
haloistaken101 is offline   Reply With Quote
Old 08-23-2008, 11:11 PM   #3
Registered User
 
Last Online: 11-19-2008 07:47 AM
Join Date: Jul 2008
Age: 18
Posts: 15
Thanks: 11
Thanked 5 Times in 3 Posts
bloodhunter16 is on a distinguished road
iTrader: 0 / 0%
Points: 3,929.46
Bank: 0.00
Total Points: 3,929.46
Re: This could help with .mef decryption.

after reading this, my eyes hurt for like half an hour T-T
bloodhunter16 is offline   Reply With Quote
Old 08-24-2008, 12:40 AM   #4
Registered User
 
Last Online: 11-27-2008 07:51 AM
Join Date: Feb 2008
Location: in a house-.-duh
Posts: 493
Thanks: 6
Thanked 363 Times in 66 Posts
pootytang7 is on a distinguished road
iTrader: 0 / 0%
Points: 16,793.77
Bank: 0.00
Total Points: 16,793.77
Re: This could help with .mef decryption.

ok i read a good amount of it, and from wat i understood i odnt think this may help for decrpyting mef, wat i belive there talking about is decrypting parts of an xml docment that have been encrypted. not a whole docment that has been encrypted with extension change.

Last edited by pootytang7; 08-24-2008 at 12:42 AM..
pootytang7 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 11:45 PM.


Powered by: vBulletin
Copyright ©2008, GamerzPlanet.Net
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Network: GamerzPlanet | ForumzPlanet | GzPUpload | GzPArcade | GzP Host | Australian Poker | Watch Desperate Housewives | Visits: