🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

how rsa works on texts and signals?

Started by
2 comments, last by taby 7 years, 11 months ago

hi.

i was wondering which place is best for my question and i found this. if its wrong move it.

i know basics of rsa cryptography but it works on numbers and not not on texts. does it use ascii code to encrypte words letter by letter? can you give me a good explanation and example? so the changing place of words and letters will not happen? i want to know is it possible to encrypte signals like voices and pictures by RSA? thank you for helping

Advertisement
All data in computers is just bytes in memory. (Or on disk.)
Those bytes in memory can be text (in various encodings -- ASCII, Latin-1, UTF-8, UTF-16, ...) or audio (in various formats) or video or executables or whatever.
Because those bytes are numbers, any encryption that can turn numbers into other numbers, and then decrypt by turning those other numbers back into the original numbers, can be used to encrypt whatever is stored in memory (or on disk.)
This is pretty basic computer science, though, so I suggest you read up on computer architecture using a good textbook of some sort.
Like perhaps http://amzn.to/29PIM2M
enum Bool { True, False, FileNotFound };

Here's my RSA code: http://www.gamedev.net/topic/677242-rsa-message-limitation-with-c-source-code/#entry5284537

See vector_of_bytes_to_biginteger() and biginteger_to_vector_of_bytes() in rsa.cpp... they convert a vector of ASCII chars to a single big integer, and back.

If you really want to know how to encrypt large data like an audio clip, get the book called Applied Cryptography 20th Anniversary Edition.

In the book, it gives an example how to break up the message (the data converted to an integer) into tiny pieces (3 digits each) and encrypt the lot of them. Of course, larger pieces can be used so long as each piece is less than p*q, where p and q are large prime numbers.

This topic is closed to new replies.

Advertisement