Connecting Tech Pros Worldwide Forums | Help | Site Map

Checking a hash?

Newbie
 
Join Date: Nov 2008
Posts: 6
#1: Nov 1 '08
Hey I'm trying to make a anti cheat that checks if the hash is the same (to check if someone hooked something in) But I got no clue how to this
So if key is 12345 it continue else it closes itself can anybody help me out whit this matter?


Thanks in advance.



btw this has to be in c#

joedeene's Avatar
Site Addict
 
Join Date: Jul 2008
Location: US of A
Posts: 587
#2: Nov 2 '08

re: Checking a hash?


Quote:

Originally Posted by fsssf

Hey I'm trying to make a anti cheat that checks if the hash is the same (to check if someone hooked something in) But I got no clue how to this
So if key is 12345 it continue else it closes itself can anybody help me out whit this matter?


Thanks in advance.



btw this has to be in c#

I'd like to welcome you to Bytes.com and to the community. I'd also like to the Posting Guidelines as you have posted a Homework Question.

As to the question, If you're wanting to use the Hashtable Class to help get the job done for you please clarify. Also, closing forms and processes aren't very difficult, I'm willing to help you furthermore if you can post more specific coding problems.

joedeene
Newbie
 
Join Date: Nov 2008
Posts: 6
#3: Nov 3 '08

re: Checking a hash?


I know you cant help¨me withouth code but after reading the link you gave me I got this question I want this to happen:


If hash key is 12345 continue
else stop.
Expand|Select|Wrap|Line Numbers
  1. If  (hashkey != 12345)
  2. MessageBox.Show("passed");
  3. Continue()
  4.  
  5. }
  6.  
  7. else
  8.  
  9. {
  10.  
  11. MessageBox.Show("not passed");
  12. Close()
  13.  
  14. }
  15.  
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#4: Nov 3 '08

re: Checking a hash?


How are you creating your hash? Have you looked at the System.Security.Cryptography namespace?

After you create a Hash key you need to store it somewhere...like in a database or XML document or text file...so that you can check to see if it's been used already.

@joedeene:

The OP is asking for direction on where to start with their project...they have not asked for a full solution to their project and so this question does not fall under the category of "homework question". Also, this question doesn't pertain to HashTables but rather the act of Hashing to create a key in order for security checking purposes.

In the future if you think that a member has broken a rule on the forum do not take it upon yourself to scold them but rather hit the "report" button so that a moderator can take the appropriate action.

-Moderator Frinny
Newbie
 
Join Date: Nov 2008
Posts: 6
#5: Nov 4 '08

re: Checking a hash?


I already got the hash code from the program but I don´t know how to calculate it whitin the program. I´ll try search on the link you gave me ( System.Security.Cryptography Namespace )

Would protecting the memory be effectfull so someone can't hook something in?
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#6: Nov 4 '08

re: Checking a hash?


Quote:

Originally Posted by fsssf

I already got the hash code from the program but I don´t know how to calculate it whitin the program. I´ll try search on the link you gave me ( System.Security.Cryptography Namespace )

I don' t know what you mean when you say you already got the hash code from the program.

Usually what happens is that you create a hash (using something like the Objects made available to you through the Cryptography Namespace) on whatever data it is you need to check and store that hash. Once the data is submitted again you use the same hashing algorithm to once again create a hash based on the data. Once you have this hash you compare it to the one you stored. This method is used so that your application doesn't have to store user passwords...it's used when sending data to check data integrity etc etc.

You will not be able to re-create the hash code if your program did not create it in the first place...and the program you're using doesn't provide you with a way to do the check.


Quote:

Originally Posted by fsssf

Would protecting the memory be effectfull so someone can't hook something in?

I have no idea what you're talking about here.

-Frinny
Newbie
 
Join Date: Nov 2008
Posts: 6
#7: Nov 4 '08

re: Checking a hash?


Quote:

Originally Posted by Frinavale

I don' t know what you mean when you say you already got the hash code from the program.

Usually what happens is that you create a hash (using something like the Objects made available to you through the Cryptography Namespace) on whatever data it is you need to check and store that hash. Once the data is submitted again you use the same hashing algorithm to once again hash the data. Once you have this hash you compare it to the one you stored. This method is used so that your application doesn't have to store user passwords...it's used when sending data to check data integrity etc etc.

You will not be able to re-create the hash code if your program did not create it in the first place...and the program you're using doesn't provide you with a way to do the check.




I have no idea what you're talking about here.

-Frinny

I´m not sure if were talking about the same thing
each program got a unique hash
example google toolbars hash is xxxxxxx
I want my program to check if the hash is xxxxxx and not something else
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#8: Nov 4 '08

re: Checking a hash?


Quote:

Originally Posted by fsssf

I´m not sure if were talking about the same thing
each program got a unique hash
example google toolbars hash is xxxxxxx
I want my program to check if the hash is xxxxxx and not something else

Are you talking about the GUID?
Newbie
 
Join Date: Nov 2008
Posts: 6
#9: Nov 4 '08

re: Checking a hash?


Quote:

Originally Posted by Frinavale

Are you talking about the GUID?

yes I´m talking about GUID hope you can help me ( already thanks for replying )
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#10: Nov 4 '08

re: Checking a hash?


Ok you need to provide more information about what you are doing.

I don't know what your application is doing so I have no idea why you would have a need for the GUID...nor do I know what the the GUID is for. Is the GUID representing a COM object? A person? A computer???

Why do you need the GUID, how did you get it, what should you be doing with it?

Please provide more information so I'm clear on what the problem is.

-Frinny
Newbie
 
Join Date: Nov 2008
Posts: 6
#11: Nov 4 '08

re: Checking a hash?


Quote:

Originally Posted by Frinavale

Ok you need to provide more information about what you are doing.

I don't know what your application is doing so I have no idea why you would have a need for the GUID...nor do I know what the the GUID is for. Is the GUID representing a COM object? A person? A computer???

Why do you need the GUID, how did you get it, what should you be doing with it?

Please provide more information so I'm clear on what the problem is.

-Frinny

My application is running a game I want to use GUID so people cant hook hacks in the GUID i s representing a hash string I need it to prevent hooking hacks in I should be blocking other hashes.
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#12: Nov 4 '08

re: Checking a hash?


Quote:

Originally Posted by fsssf

My application is running a game I want to use GUID so people cant hook hacks in the GUID i s representing a hash string I need it to prevent hooking hacks in I should be blocking other hashes.

Does your application include the game as a resource?

Is your game running using COM or .NET?

If it's COM, a GUID is created for the application so that it can be registered (into the Windows Registry). If the GUID is changed and your application includes it as a resource than your application will crash.

If it's .NET then hopefully the application has been compiled with a Strong Name ...if the application is changed then the Strong Name will also change.

I haven't actually had to use Strong-Named assemblies yet....So please check out the link on Strong Names that I provided you with because it provides you with articles on how to create and use Strong-Named assemblies and will cover the topic much more thoroughly than I could.

(Note that ever assembly that a strong-named assembly references must be signed with a strong name as well)

-Frinny
Reply