Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,152 members, 7,818,476 topics. Date: Sunday, 05 May 2024 at 04:50 PM

Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To (3018 Views)

Universal Files And Folders Encryption (PGP) - Good For You / Please Need Help With Writing These C++ Programmes Please This Is Really Urgent / Where Can One Learn Vb.net Cheap And Fast In Lagos (2) (3) (4)

(1) (2) (Reply) (Go Down)

Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by litusista(f): 7:18pm On Jul 14, 2012
I am working on my final year project in school, and i just have like 10% knowledge about programming. I know a little bit of java, but i'm not rily into programming though i'm a computer student. the issue now is i need to write an encryption algorthm for my final year project.Can anybody help out? i can give all my effort to learning within the next one month. is it possible? i'm doing my research on network security, over a LAN. i need ideas..
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by ocheejemb: 7:33pm On Jul 14, 2012
Depends on how complex your algorithm needs to be. I don't think you need super strong programming skills to implement a simple algorithm. You could look at Triple DES or AES and try to do simplified version.
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by Acidosis(m): 8:12pm On Jul 14, 2012
My Litusista, God will see you through
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by Nobody: 9:38pm On Jul 14, 2012
is java the required language?

but, na wa o, computer student that's not really into programming, 10%, final year, someone calling God to see friend through.
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by Acidosis(m): 10:19pm On Jul 14, 2012
webdezzi: is java the required language?

but, na wa o, computer student that's not really into programming, 10%, final year, someone calling God to see friend through.

Yes sir, and I'll tell God over and over again. The fact that you came here to complain on her thread without posting any meaningful solution, is enough reason to ask God to raise helpers and problem solvers. .
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by Nobody: 10:40pm On Jul 14, 2012
Why don't you learn programming yourself? There are many language to choose from...you can get started with simple but powerful scripting language
like Python or if you intend heavy-lifting you can venture into Java, C/C++ etc. My point is, with determination and courage you can do even more
than encryption. Just get started... Programming is free, it only demands time and energy to master. All the resources you need are just a web-click
away...
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by litusista(f): 11:00pm On Jul 14, 2012
@ all, thanks. i have tried java, vb before i was even taught python sometimes, but my problem with programming is patience. i get discouraged when i keep having errors and bugs in simple programs. i just need a simple algorithm that will be implemented on a LAN. i'm more familiar with java though.
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by Nobody: 11:08pm On Jul 14, 2012
Acidosis:
Yes sir, and I'll tell God over and over again. The fact that you came here to complain on her thread without posting any meaningful solution, is enough reason to ask God to raise helpers and problem solvers. .

Guy, you go pull God down come code this project the way i dey see your faith o.

i just asked what language she will be using, though she talked about her little experience with java, that does not confirm java as her intended language
but i really wont be helping also if i keep mute and let her feel she is ok with 10%, thats meant to make her start working. i dont know about you but i wont accept treatment from a medical doctor who has 10% knowledge about medicine, well maybe take wound treatment but not injections
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by Nobody: 11:18pm On Jul 14, 2012
LAN? why not paste full description of the project. you intend to have it run on a network? the clearer the better
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by ektbear: 6:58am On Jul 15, 2012
Just use AES, RSA or something
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by Fayimora(m): 8:47am On Jul 15, 2012
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by lordZOUGA(m): 9:12am On Jul 15, 2012
@OP, from ur post, what u need is a XOR encryption algorithm... Its most easy to use, all you need is a loop... No need for external library
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by lordZOUGA(m): 10:53am On Jul 15, 2012
here is an example function that will encrypt or decrypt a given data. Unfortunately, I use C++ but you should get the idea and implement in java.

const String myData = "my special stuff";
const String myKey = "aKey";
encryptDecrypt(myData, myKey);

/*encryptDecrypt() encrypts or decrypts aData with aKey depending on the state of the data*/
String encryptDecrypt(const String aData, const String aKey){
int j = 0;
String Dencrypted;
for(int i = 0; i < aData.size(); i++){
/*we make sure that the loop of the key is maintained whenever the data is longer than the key*/
if(j == aKey.size() - 1){
j = 0;
}
/*we encrypt/decrypt string using the exclusive or operator '^' and then append encrypted or decrypted char to String*/
Dencrypted[i] = aData[i] ^ aKey[j];
j++;
}
return Dencrypted;
}
now your data can only be read by those with your key. the function above can decrypt and encrypt any given data.
You can google about XOR in java tho..
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by Javanian: 11:05am On Jul 15, 2012
^^^Nice one!...@op follow this...But you can use a Hash Map in Java it will be much easier...
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by Nobody: 4:56pm On Jul 15, 2012
i'll recommend the link provided by Fayimora as it imports better encryption classes
but you can start off with the example provided. i tried to port it to Java below


package xor;
import java.util.ArrayList;
import java.util.List;

public class Main {

private static String myData="my special stuff";
private static String myKey="aKey";

public static void main(String[] args) {
/*encryptDecrypt() encrypts or decrypts aData with aKey depending on the state of the data*/
String the_result=encryptDecrypt(myData, myKey);
//seeing is believing
System.out.println(the_result);
}


private static String encryptDecrypt(String aData, String aKey){
int j = 0;
List Dencrypted=new ArrayList();
for(int i = 0; i < aData.length(); i++){
/*we make sure that the loop of the key is maintained whenever the data is longer than the key*/
if(j == aKey.length() - 1){
j = 0;
}
/*we encrypt/decrypt string using the exclusive or operator '^' and then append encrypted or decrypted char to String*/
Dencrypted.add(aData.charAt(i) ^ aKey.charAt(j));
j++;
}
StringBuilder out = new StringBuilder();
for (Object o : Dencrypted){
out.append(o.toString());
}
return out.toString();
}


}
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by ektbear: 5:30pm On Jul 15, 2012
xor encryption has some serious flaws

just google why you shouldn't use it

anyway, AES or RSA are both pretty accessible from almost any programming language...use one of them
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by lordZOUGA(m): 5:49pm On Jul 15, 2012
ekt_bear: xor encryption has some serious flaws

just google why you shouldn't use it

anyway, AES or RSA are both pretty accessible from almost any programming language...use one of them
yes it is flawed But she said she is 10% proficient....
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by ektbear: 5:55pm On Jul 15, 2012
you don't need to be proficient in a programming language to use a library/API that someone else built.

Just need to be able to google, copy and paste, and then do some minor modifications.

E.g., for python, googling yields the following:
http://www.codekoala.com/blog/2009/aes-encryption-python-using-pycrypto/
http://eli.thegreenplace.net/2010/06/25/aes-encryption-of-files-in-python-with-pycrypto/

1 Like

Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by lordZOUGA(m): 6:00pm On Jul 15, 2012
ekt_bear: you don't need to be proficient in a programming language to use a library/API that someone else built.

Just need to be able to google, copy and paste, and then do some minor modifications.

E.g., for python, googling yields the following:
http://www.codekoala.com/blog/2009/aes-encryption-python-using-pycrypto/
http://eli.thegreenplace.net/2010/06/25/aes-encryption-of-files-in-python-with-pycrypto/
that seems like too much "googling" for someone that asked for an encryption algorithm on Nairaland. I believe the OP has an aversion for google.
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by ektbear: 6:05pm On Jul 15, 2012
lmao cheesy
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by logica(m): 7:35pm On Jul 15, 2012
Is it you have to WRITE an algorithm, or you have to USE an algorithm?

If the former, check this: http://en.wikipedia.org/wiki/SHA-2

If latter, simply get a handle on Spring Security API and do this:

Sha512DigestUtils.shaHex(stringInput)

The utility method takes the input string
stringInput
and returns the encrypted string (digest).
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by ektbear: 8:54am On Jul 16, 2012
SHA-2 performs hashing. This is different from encryption.

Hashing, you cannot recover the original message.

Encryption, you can.

So if you are storing passwords for say Nairaland users, hashing is suitable: just store the hashed version of a user's password. And then when you need to log them in, hash the text they type, then test for equality against the password in their database.

However, if i want to send a secret email to the OP, and don't want anyone else to read it, I had better use encryption. If I hash my email, then the OP won't be able to read it cheesy
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by logica(m): 2:48pm On Jul 16, 2012
Dude, so what do u call the process through which u produce a hash? Hmmm, I thot for a second and the only word I found was "encryption". While it's true this is one way encryption (that is what "hashing" is, but it is still encryption and falls under the study called cryptography), do you see anything in the requirements that say this does not suffice?

Have you asked the OP how she plans to use encryption? Will a hash not suffice if all she wants to use it for is storage of ENCRYPTED passwords?

Everybody on this thread have made assumptions, mine is to make the simplest assumptions while you assumed he needed decryption (since nothing like that was stated). I am sure that one day when you are experienced enough you will learn to think simple; before you go wasting time on unnecessary complexity.
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by litusista(f): 2:38pm On Jul 17, 2012
webdezzi: LAN? why not paste full description of the project. you intend to have it run on a network? the clearer the better
Yea, exactly. I intend to run it n a network, my school Network.
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by logica(m): 5:10pm On Jul 17, 2012
litusista:
Yea, exactly. I intend to run it n a network, my school Network.
What are you running? You have not even been able to articulate your project. Do you even have a clue what you are trying to do?
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by ektbear: 8:21pm On Jul 17, 2012
I don't see any reason to get so defensive. If it turns out that all he in fact needs is hashing, then fine. If he needs actual encryption, then also fine.
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by logica(m): 3:01am On Jul 18, 2012
ekt_bear: I don't see any reason to get so defensive.
LOL. Defensive? Where did that come from? At best I'm just a bit irritated at ITK combined with ignorance (YOU). At worst, irritated by novices who don't seem to have realized that computing is not for them (OP).
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by ektbear: 4:31am On Jul 18, 2012
Take a chill pill...no reason to be irritated at either I or the OP. Whether computing is for the OP or not, it certainly won't help him/her to receive incomplete or incorrect information.
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by litusista(f): 5:56pm On Jul 18, 2012
logica: What are you running? You have not even been able to articulate your project. Do you even have a clue what you are trying to do?
here is the idea. I am to procure a solution (a security scheme)to help improve data transmission security over a LAN. My supervisor said there's no way i'm going to do something new if i dont propose a new algorithm. The LAN in focus here is my school network, a university network.
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by Javanian: 6:46pm On Jul 18, 2012
What you have on this thread is enough to do your project...infact i think it has already been done...if @ this point you still dont know what to do....i suggest you get some one do it for you...or you do something else...
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by logica(m): 8:37pm On Jul 18, 2012
ekt_bear: Take a chill pill...no reason to be irritated at either I or the OP. Whether computing is for the OP or not, it certainly won't help him/her to receive incomplete or incorrect information.
OK, I will in the interim. smiley

litusista:
here is the idea. I am to procure a solution (a security scheme)to help improve data transmission security over a LAN. My supervisor said there's no way i'm going to do something new if i dont propose a new algorithm. The LAN in focus here is my school network, a university network.
If you check the page and read it entirely to the end, you will see where there is a reference to SSL, TLS, etc: http://en.wikipedia.org/wiki/SHA-2

The SHA-2 hash function is implemented in some widely used security applications and protocols, including TLS and SSL, PGP, SSH

Now the assumption I am making is you are trying to secure the actual data transmission over a network. That is exactly what SSL and SSH do (so yes you are reinventing the wheel). Find out how they work and you are almost there.
Re: Who Can Help With Writing An Encryption Algorithm? How Soon Can One Learn How To by StarrMatthieu: 2:35am On Jul 19, 2012
Thanks a lot

(1) (2) (Reply)

Advantage of using Blender OS 4 creating animated films, visual effects, art etc / Chrome Extension And Enhancement Of A Platform In Context To NL Anti-spambot / Hot!!! How To Learn To Code Using Your Android Device

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 42
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.