Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,276 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,167 people online right now. Registration is fast and FREE... Join Now!




cipher

 
Reply to this topicStart new topic

cipher, encripting a message

jhedz
post 11 Mar, 2008 - 06:13 AM
Post #1


New D.I.C Head

*
Joined: 11 Mar, 2008
Posts: 5

how can i encrypt a message after being type..can you please help me...if u know how to encrypt or what is the code for encripting please tell me..
thanks!!!
User is offlineProfile CardPM

Go to the top of the page

NickDMax
post 11 Mar, 2008 - 06:28 AM
Post #2


2B||!2B

Group Icon
Joined: 18 Feb, 2007
Posts: 2,857



Thanked 47 times

Dream Kudos: 550
My Contributions


search the snippets.

There are lots of different types of "encryption" some of them are actually encodings (cyphers) which just disguise the data and are ok for hiding your data from your cousin, but will not even slow your run of the mill government agency. Then there is encryption -- encryption schemes are a little more complicated and generally heavy on the mathematics. -- and they still may not slow down government agencies.
User is offlineProfile CardPM

Go to the top of the page

jhedz
post 12 Mar, 2008 - 04:55 PM
Post #3


New D.I.C Head

*
Joined: 11 Mar, 2008
Posts: 5

i need to program a paired cipher...
User is offlineProfile CardPM

Go to the top of the page

NickDMax
post 12 Mar, 2008 - 06:03 PM
Post #4


2B||!2B

Group Icon
Joined: 18 Feb, 2007
Posts: 2,857



Thanked 47 times

Dream Kudos: 550
My Contributions


??? What is a paired cipher ???

I know a good little bit about cryptography and I have to say that I don't know what a paired cipher is. I *think* you may be talking about a substitution cipher (like a decoder ring or Caesar cypher). But my google results on the term make me wonder if this has something to do with DNA (when last I read up on it, there were some really interesting things going on with DNA and cryptography -- mostly on the code breaking side).

Anyway, what is a paired cipher? Can you describe it?
User is offlineProfile CardPM

Go to the top of the page

jhedz
post 13 Mar, 2008 - 05:23 AM
Post #5


New D.I.C Head

*
Joined: 11 Mar, 2008
Posts: 5

hi nick...i attached the file of what is paired cipher is..hope u will help me...tnx...
please reply as soon as possible...tnx again!!!!


Attached File(s)
Attached File  Paired_Cipher.doc ( 115k ) Number of downloads: 24
User is offlineProfile CardPM

Go to the top of the page

AmitTheInfinity
post 13 Mar, 2008 - 05:40 AM
Post #6


C Surfing ∞

Group Icon
Joined: 25 Jan, 2007
Posts: 1,015



Thanked 34 times

Dream Kudos: 125
My Contributions


QUOTE(jhedz @ 13 Mar, 2008 - 06:53 PM) *

hi nick...i attached the file of what is paired cipher is..hope u will help me...tnx...
please reply as soon as possible...tnx again!!!!



well, that sounds bit interesting. but I would love to help you when you come up with some efforts by yourself. I mean the algo. is explained in detail in your document. All you need to do is code those 2 lines.

Still to get you started, here are my suggestions.

-> you can go by 2 ways. First is to have an array of characters. Second is to work on ascii values directly [recommended]

-> If you go the ascii values way then just make your input string all caps first.

-> subtract 64 from both the characters you are encrypting in current iteration. [ascii of 'A' this takes it to range of 1 to 26]

-> apply your 2 line algorithm to get enciphered characters.
QUOTE

C1= (1xP1 + 3xP2) mod 26 + 1
C2= (2xP1 + 7xP2) mod 26 + 1


-> add 64 to the enciphered characters [this gives you the ascii for the enciphered character]

-> do this in loop till your input string ends. and you will get your enciphered message.


I hope this will help you. smile.gif
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/22/08 12:31AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month