C Program to Perform ROT47 Cipher
The ROT47 Cipher can be implemented in the following C/C++ Function. The ROT47 Cipher helps to encode/decode plain-text.
#include <stdio.h>
#include <string.h>
void rot47(char *buf, int l) {
for (int i = 0; i < l; ++ i) {
if (buf[i] >= 33 && buf[i] <= 126) {
buf[i] = 33 + ((buf[i] + 14) % 94);
}
}
}
int main(int argc, char* argv[]) {
if (argc == 0) {
return 0;
}
for (int i = 1; i < argc; ++ i) {
rot47(argv[i], strlen(argv[i]));
printf("%s\n", argv[i]);
}
return 0;
}
We can compile using gcc compiler:
$ ./gcc rot47.c -o rot47
Then, we can perform the ROT47 Cipher on the command line parameters:
$ ./rot47 "Hello, World" "How Are You!"
w6==@[ (@C=5
w@H pC6 *@FP
The same text ROT47-ed twice will revert to original text.
$ ./rot47 "w6==@[ (@C=5" "w@H pC6 *@FP"
Hello, World
How Are You!
--EOF (The Ultimate Computing & Technology Blog) --
Reposted to Blog
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Thank you for reading ^^^^^^^^^^^^^^^
NEW! Following my Trail (Upvote or/and Downvote)
Follow me for topics of Algorithms, Blockchain and Cloud.
I am @justyy - a Steem Witness
https://steemyy.com
My contributions
- Video Downloader
- Steem Blockchain Tools
- Free Cryptos API
- VPS Database
- Computing Technology Blog
- A few useless tools
- And some other online software/tools
- Merge Files/Videos
- LOGO Turtle Programming Chrome Extension
- Teaching Kids Programming - Youtube Channel and All Contents
Delegation Service
Important Update of Delegation Service!
Support me
If you like my work, please:
- Buy Me a Coffee, Thanks!
- Become my Sponsor, Thanks!
- Voting for me:
https://steemit.com/~witnesses type in justyy and click VOTE
- Delegate SP: https://steemyy.com/sp-delegate-form/?delegatee=justyy
- Vote @justyy as Witness: https://steemyy.com/witness-voting/?witness=justyy&action=approve
- Set @justyy as Proxy: https://steemyy.com/witness-voting/?witness=justyy&action=proxy
Alternatively, you can vote witness or set proxy here: https://steemit.com/~witnesses
cryptography programming is also my hobby. My first encryption program was written in VB6 using aes rijndael algorithm.
However, plz sir check my today's post. I'm an active delegator (66K) & set @justyy as my witness proxy. I didn't get upvote from your trail -
https://steemit.com/hive-129948/@rme/steemit
Thanks. voted here.
thank you :)
Hey @justyy!
Im reaching to you to inform that now the Latino Community have a Witness Node (@cotina)
I'm falling in love with your work, Im a developer too, always commited to improve the things automating tasks. I will make sure to always offer the best to Steemit and our blockchain ;)
Im the community manager there,
Thank you @alejos7ven.