<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://bf2tech.uturista.pt/index.php?action=history&amp;feed=atom&amp;title=Cookbook%3AComputing_CD_Key_Hashes</id>
	<title>Cookbook:Computing CD Key Hashes - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://bf2tech.uturista.pt/index.php?action=history&amp;feed=atom&amp;title=Cookbook%3AComputing_CD_Key_Hashes"/>
	<link rel="alternate" type="text/html" href="https://bf2tech.uturista.pt/index.php?title=Cookbook:Computing_CD_Key_Hashes&amp;action=history"/>
	<updated>2026-08-06T00:34:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://bf2tech.uturista.pt/index.php?title=Cookbook:Computing_CD_Key_Hashes&amp;diff=86&amp;oldid=prev</id>
		<title>Pireax: Created page with &quot;==  Problem  ==  You have one or more BF2 CD keys that you want to convert into key hashes. BF2 uses [http://en.wikipedia.org/wiki/MD5 MD5] [ht...&quot;</title>
		<link rel="alternate" type="text/html" href="https://bf2tech.uturista.pt/index.php?title=Cookbook:Computing_CD_Key_Hashes&amp;diff=86&amp;oldid=prev"/>
		<updated>2018-06-21T19:27:35Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==  Problem  ==  You have one or more BF2 CD keys that you want to convert into &lt;a href=&quot;/index.php/Player_Identity#CD_Key_Hash&quot; title=&quot;Player Identity&quot;&gt;key hashes&lt;/a&gt;. BF2 uses [http://en.wikipedia.org/wiki/MD5 MD5] [ht...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==  Problem  ==&lt;br /&gt;
&lt;br /&gt;
You have one or more BF2 CD keys that you want to convert into [[Player_Identity#CD_Key_Hash|key hashes]]. BF2 uses [http://en.wikipedia.org/wiki/MD5 MD5] [http://en.wikipedia.org/wiki/Cryptographic_Hash_Function hashes] of players&amp;#039; CD keys to uniquely identify their copy of BF2. This is usually used in connection with some of the player banning functions, but has other uses as well. Sometimes it&amp;#039;s useful to have a way to convert CD keys into hashes yourself.&lt;br /&gt;
&lt;br /&gt;
==  Solution  ==&lt;br /&gt;
&lt;br /&gt;
Here are two solutions, depending on what it is you would like to accomplish:&lt;br /&gt;
&lt;br /&gt;
If you just want to find your own CD key hash, the easiest way to do it is to use the [[BF2_Key_Hasher|BF2_Key_Hasher]] program; it reads the CD key from your game and pops up an easy-to-read dialog box that gives you your hash.&lt;br /&gt;
&lt;br /&gt;
On the other hand, if you have a list of CD keys that you want to convert to hashes (something cybercafes, for example, commonly need to do), or if you want to incorporate the process into your own software for some reason, or if you just want to understand the algorithm that&amp;#039;s used, here&amp;#039;s a short Python function that does the job:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import md5&lt;br /&gt;
 &lt;br /&gt;
  def keyHash(cdKey):&lt;br /&gt;
      &amp;#039;&amp;#039;&amp;#039;Returns the MD5 hash of a BF2 CD key, after removing any&lt;br /&gt;
         dashes and uppercasing.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
      cleanCdKey = cdKey.replace(&amp;#039;-&amp;#039;,&amp;#039;&amp;#039;).upper()&lt;br /&gt;
      return md5.new(cleanCdKey).hexdigest()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  Discussion  ==&lt;br /&gt;
&lt;br /&gt;
The algorithm is very simple: just remove any dashes (&amp;quot;-&amp;quot;) from the CD key, convert everything to upper-case, then run it through the standard MD5 algorithm.&lt;br /&gt;
&lt;br /&gt;
Here&amp;#039;s an example of how to use this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
print keyHash(&amp;quot;J6EK-Y8JM-HT2P-QQRF-Y21E&amp;quot;) # No, it&amp;#039;s not a real key!&lt;br /&gt;
# prints the CD key hash: 5745588be00e1a65a334f4a71d738106&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  Submitted By  ==&lt;br /&gt;
&lt;br /&gt;
--Woody&lt;/div&gt;</summary>
		<author><name>Pireax</name></author>
	</entry>
</feed>