Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Creating a simple hashing program on Eclipse using Java

[Image: hashing_screen.png]

Can anyone guide me in the right direction so I can program this to hash the text?

I'm completely new to programming, so any help would be massively appreciated.

I've tried using guides online but they are too complex for the simple program I want to make
Do you want to actually learn Java or just have the program written for you?
First you'd want to figure out the hash algorithm you wish to use then find out how to do it in java.
Then essentially you'd want to do something like this.

Code
String hashedValue = hashFunction(txtInput.getText());
txtOuput.setText(hashedValue);
(Jul 21, 2016 10:50 AM)Stealth™ Wrote:  Do you want to actually learn Java or just have the program written for you?

I want to learn Java of course, just cant seem to understand how I go about doing this
(Jul 21, 2016 10:57 AM)Sace Wrote:  I want to learn Java of course, just cant seem to understand how I go about doing this

Well, learning Java and learning how to hash properly are two different things. However, implementing a hashing function in java is an excellent way to learn. For the hasing function; you want a good spread of hashes; similar, but not identical values, should produce different hashes. Not just different but close ones. They should produce very different ones.

As for how to implement it in java, check Haze+,s reply. You implement the hashing algorithm and call it.
Personally i think you should start by learning java
(Jul 21, 2016 12:51 PM)192168 Wrote:  Personally i think you should start by learning java

Best way to learn a language is to create an application.
[Image: LZt9758.gif]
Thanks for the help guys

[Image: hasher1.png]

I have a MD5 Example to the left, however it displays it through the console.
How do I display the results on the output screen?

Also, i'm unsure what parts of the example to change in order for it to work on the simple text part.
(Jul 22, 2016 09:15 AM)Sace Wrote:  Thanks for the help guys

[Image: hasher1.png]

I have a MD5 Example to the left, however it displays it through the console.
How do I display the results on the output screen?

Also, i'm unsure what parts of the example to change in order for it to work on the simple text part.

Using System.out.println(); always outputs the information to the console. In order to deliver the text to your GUI I'd suggest making an updating function to call within your mainframe.

Just create a variable to hold the value of the String (instead of " HASH TO APPEAR HERE !! ") and update that variable within the hash example class. After creating the globally reachable variable, you'd call your update function in the frame (you'd call this function where you currently have System.out.println() ) which basically just resets the text to whatever the destination variable holds.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by nucleo_type09Apr 15, 2024 08:30 AM 4 199 Apr 15, 2024 08:30 AM
Last Post: nucleo_type09
[Java] by GulpDec 7, 2018 05:41 AM 5 230 Dec 7, 2018 05:41 AM
Last Post: .Skies
[Python] by GlassAug 14, 2018 10:22 AM 2 152 Aug 14, 2018 10:22 AM
Last Post: Glass