|
-
Jul 6th, 2013, 07:54 AM
#1
Thread Starter
Addicted Member
How to make a Cypher [Encrypting & Decrypting String]
I would like to know how to make a relatively basic Cypher using a basic algorithm. I have tried many times but fail miserably.
I am very sorry I cannot provide you with a basis of code for you to work of with but hopefully a detailed explanation might do it.
Features of the Cypher.
- Ability to Encrypt & Decrypt String data.
- Ability to customize a password in order to make it harder to decrypt.
- In order to decrypt the recipient must have the password the first user encrypted with.
Here's the trick, Once lets say I encrypt the string "Hello World" and then the encrypted data turns into "47mcsDwej#E3@%#@" and then when I encrypt "Hello World" with the same password again, a new encryption will show up as well as it being able to decrypt itself! So same message that can be of multiple encryptions.
Last edited by Reapism; Jul 6th, 2013 at 07:55 AM.
Reason: Added a feature
-
Jul 6th, 2013, 08:04 AM
#2
Re: How to make a Cypher [Encrypting & Decrypting String]
Hi,
There are various encryption techniques available for you to use so as a starting point having a look here:-
http://msdn.microsoft.com/en-us/libr...code-snippet-1
Hope that helps,
Cheers,
Ian
-
Jul 6th, 2013, 08:06 AM
#3
Re: How to make a Cypher [Encrypting & Decrypting String]
So, you want us to do your homework for you? Probably not going to happen, or shouldn't at least. First things first, what's your algorithm? You don't need any programming experience to create that because it's just a series of steps and someone should be able to follow them with a pen and paper. Without an algorithm, you don't know what your code actually has to do so it should be no surprise that you can't write the code to do it. Start with the broad strokes and then break each step up into smaller steps and keep doing that until you have everything as simple as it can go. Only when you can follow those steps with a pen and paper and get the correct result should you even consider writing any code. You don't need us for that, unless you try to follow the steps and don't get the correct result, in which case you should post your algorithm and we can help you fix it for yourself.
-
Jul 6th, 2013, 09:45 AM
#4
Re: How to make a Cypher [Encrypting & Decrypting String]
then when I encrypt "Hello World" with the same password again, a new encryption will show up as well as it being able to decrypt itself!
Well, if you can pull that off you may well be getting an email from the Pentagon! Just how exactly would the password held by the recipient be able to unlock two different encryptions, assuming that it's not a trial and error algorithm .. stop when you come up with a word that's in the dictionary!
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Jul 6th, 2013, 01:29 PM
#5
Re: How to make a Cypher [Encrypting & Decrypting String]
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jul 6th, 2013, 11:11 PM
#6
Thread Starter
Addicted Member
Re: How to make a Cypher [Encrypting & Decrypting String]
 Originally Posted by jmcilhinney
So, you want us to do your homework for you? Probably not going to happen, or shouldn't at least. First things first, what's your algorithm? You don't need any programming experience to create that because it's just a series of steps and someone should be able to follow them with a pen and paper. Without an algorithm, you don't know what your code actually has to do so it should be no surprise that you can't write the code to do it. Start with the broad strokes and then break each step up into smaller steps and keep doing that until you have everything as simple as it can go. Only when you can follow those steps with a pen and paper and get the correct result should you even consider writing any code. You don't need us for that, unless you try to follow the steps and don't get the correct result, in which case you should post your algorithm and we can help you fix it for yourself.
Hey, why don't I just do that. It looks like I posted a topic for a reason. I have not asked anyone to do any sort of homework, I don't know where your assumption comes from however, to write the algorithm is challenging in itself. I am trying to declare the alphabet and somehow take the the letters and add and subtract the char value, maybe that will work, I don't know its difficult to try to write a algorithm if you don't know the basis. Please, all I ask is a bit of help but in all honesty, Please don't assume I am asking for homework, I would commission it if I was...
-
Jul 6th, 2013, 11:12 PM
#7
Thread Starter
Addicted Member
Re: How to make a Cypher [Encrypting & Decrypting String]
 Originally Posted by IanRyder
I will have a look thanks Ian. I just am really excited to make this.
-
Jul 6th, 2013, 11:13 PM
#8
Thread Starter
Addicted Member
Re: How to make a Cypher [Encrypting & Decrypting String]
Actually, you would be very suprised. I do have a program that does it but I obviously don't have the source, just the application. I believe he is using some sort of randomization.
-
Jul 7th, 2013, 12:26 PM
#9
Re: How to make a Cypher [Encrypting & Decrypting String]
 Originally Posted by Reapism
Actually, you would be very suprised. I do have a program that does it but I obviously don't have the source, just the application. I believe he is using some sort of randomization.
I would indeed. Especially if it was using randomization. The only way to do it without double locking (a system in which coder and reader are entirely ignorant of each other's passwords allowing for random second keys to be applied but requiring the message to pass between the sender and the receiver several times) would be to have something within the encrypted version which reveals the encryption method but that would be both non-standard and potentially self defeating since clearly it could not itself be encrypted and therefore would be extractable without the need of a password.
There are algorithms which are relatively secure requiring no passwords and which would contain their own decoding methods but the trouble with those are that they remain secure only until the secret is discovered at which point all messages will be readable. I devised one many years ago and I've always wanted to set breaking it as a contest somewhere to see just how sturdy it would be but I have no doubt that someone would crack it eventually even in its most sophisticated form. But then that's probably true of pretty much all encryption methods even today. With enough time and computing power all codes are potentially breakable.
As for algorithms, just look up codes on t'Internet. From the Caesar (Rot-13) to Playfair (a favourite of the kind of cryptic crossword setter who really like to make me suffer!) there are dozens of examples available. Anything you can do on paper you can just as easily do in code (er ... VB code, not the other kind, obviously!)
Last edited by dunfiddlin; Jul 7th, 2013 at 12:38 PM.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Jul 8th, 2013, 05:43 AM
#10
Re: How to make a Cypher [Encrypting & Decrypting String]
 Originally Posted by dunfiddlin
I would indeed. Especially if it was using randomization. The only way to do it without double locking (a system in which coder and reader are entirely ignorant of each other's passwords allowing for random second keys to be applied but requiring the message to pass between the sender and the receiver several times) would be to have something within the encrypted version which reveals the encryption method but that would be both non-standard and potentially self defeating since clearly it could not itself be encrypted and therefore would be extractable without the need of a password.
I imagine it is something akin to salting passwords before hashing them. The idea being to be able to encrypt the same message twice, but not be able to tell from the ciphertexts that the plaintexts are the same. The message would clearly need to be a combination of the output of the cipher and the salt - in the same way that you store the salt and the hash of a password - and it would need some careful cryptographic analysis to ensure that there wasn't a way of computing whether two messages were identical even without decrypting (i.e. an attacker wouldn't know the content of the messages, but would know that they're the same).
-
Jul 8th, 2013, 05:50 AM
#11
Re: How to make a Cypher [Encrypting & Decrypting String]
 Originally Posted by Reapism
- Ability to Encrypt & Decrypt String data.
Nowadays, encryption algorithms generally work on bytes, not characters. (Quick, what's the result of ROT13'ing the string 'é'?) You probably (read: definitely) do not want to have your encryption take responsibility for encoding the string data into bytes.
 Originally Posted by Reapism
- In order to decrypt the recipient must have the password the first user encrypted with.
If you're doing a search, be aware that this is called 'Symmetric Encryption'. There is also something called 'Asymmetric Encryption' where to decrypt you need a different key to that used to encrypt (obviously, the two keys are mathematically related).
-
Jul 8th, 2013, 05:53 AM
#12
Re: How to make a Cypher [Encrypting & Decrypting String]
 Originally Posted by dunfiddlin
There are algorithms which are relatively secure requiring no passwords and which would contain their own decoding methods but the trouble with those are that they remain secure only until the secret is discovered at which point all messages will be readable. I devised one many years ago and I've always wanted to set breaking it as a contest somewhere to see just how sturdy it would be but I have no doubt that someone would crack it eventually even in its most sophisticated form. But then that's probably true of pretty much all encryption methods even today. With enough time and computing power all codes are potentially breakable.
That's not how cryptographers use the term 'secure'. An attacker is assumed to have perfect knowledge of the encryption algorithm.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|