• 0

I am writing a ceaser cipher


Question

hello all I am writing ceaser cipher in java (to go along with a massive encryption tool when its all done)...

I just wanted a few opinions really...

should I include special characters? like punctuation ... if I leave puntuation out of a cipher it could be easier to decrypt ... example

hello bob, how is you're mother?

could looks like

gyrrq tqt, gqp dz uqi'wy fqmgyw?

obviously I can see that the first word is probably hello and that the second is a name or something to address someone due to the normal letter lay out if wrong I can for sure see the " ' " which would suggest "re" .... but if I remove all punctuation sentences can become hard to understand or meanings can change all together.

also should i make everything a standard lower case? this is my alphabet char array so far:

{'a', 'b', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',

'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1',

'2', '3', '4', '5', '6', '7', '8', '9', '0', '\'', '\"', ',', '@', '[', ';', '#', ']', '-', '_', '~', '{', '}', '?', '*', '?',};

is this going a bit OTT? or good to allow proper communication? i need to add more special characters and maybe remove the caps (as most people would assume the first would be a cap in a sentence which allows a small amount of elimination)

opinions? thoughts? ideas? extras?

Link to comment
https://www.neowin.net/forum/topic/1154212-i-am-writing-a-ceaser-cipher/
Share on other sites

14 answers to this question

Recommended Posts

  • 0

What type of encryption tool are you going to write that uses a caesar cipher?

Ceaser ciphers are pretty weak for security, as are most rotational ciphers, so I hope its not meant to protect something valuable. ROT13 is another good one to play with, but it doesnt use punctuation, only letters of the alphabet.

If you really wanted to mess with someone, make it load the russian cyrillic alphabet as a cipher :p

  • 0

What type of encryption tool are you going to write that uses a caesar cipher?

meh just an extra layer ... its ceaser ciphers (maybe going into enigma) the ciphered text will then be encrypted using RSA with an optional AES

Ceaser ciphers are pretty weak for security, as are most rotational ciphers, so I hope its not meant to protect something valuable. ROT13 is another good one to play with, but it doesnt use punctuation, only letters of the alphabet.

If you really wanted to mess with someone, make it load the russian cyrillic alphabet as a cipher :p

ha! I like that sounds amusing ... like i said just adding it on for that little bit extra ya know :p

  • 0

"meh just an extra layer"

"will then be encrypted using RSA with an optional AES"

So in other words utterly pointless.. Like mac filtering or disabling your dhcp server as "extra security layer" on your wireless while your using WPA2.

Clearly not following KISS

  • 0

"meh just an extra layer"

"will then be encrypted using RSA with an optional AES"

So in other words utterly pointless.. Like mac filtering or disabling your dhcp server as "extra security layer" on your wireless while your using WPA2.

Clearly not following KISS

pretty much pointless yes , just for practice mostly! it wont do anything.... except annoy who ever is trying to decrypt it as well as suck up processing power lol !

  • 0

"annoy who ever is trying to decrypt it"

So you mean after they break RSA or AES -- so your talking someone with the computer power of a small country at his disposable? You mean that guy, that guy that really wants to know those launch codes SPEhosting is sending via some special code he wrote.. That guy?

I am fairly sure, nobody is going to spend 2 seconds on "cracking" your encryption - unless you put some sort of prize on it in the 1,000's of dollars, etc. Now if in the 100's of Ks or Millions you might get some serious people trying to break it. If not then sorry nobody is going to be wasting time trying to break your "practice" code.

Thats great if you want to practice, practice with something useful - so some software using using a "Caesar Cipher" based encryption makes sense. But then wrapping it inside of AES, that is not practice that is just pointless complexity that serves no purpose.

KISS!!

  • Like 3
  • 0

"annoy who ever is trying to decrypt it"

So you mean after they break RSA or AES -- so your talking someone with the computer power of a small country at his disposable? You mean that guy, that guy that really wants to know those launch codes SPEhosting is sending via some special code he wrote.. That guy?

I am fairly sure, nobody is going to spend 2 seconds on "cracking" your encryption - unless you put some sort of prize on it in the 1,000's of dollars, etc. Now if in the 100's of Ks or Millions you might get some serious people trying to break it. If not then sorry nobody is going to be wasting time trying to break your "practice" code.

Thats great if you want to practice, practice with something useful - so some software using using a "Caesar Cipher" based encryption makes sense. But then wrapping it inside of AES, that is not practice that is just pointless complexity that serves no purpose.

KISS!!

wow you are just a bundle of joy to day aint ya :p lol the RSA and AES have a very vital role in my program, its for a secure communication which will be built in to android communications (text messaging and hopefully phone calls, which may be a little harder) I have already started this app in a basic messenger style (which is easy as hell) but I want to make it so people can use their text messages and minutes rather then their data allowence. the point of RSA being included is so that people dont have to have a key they made up... because lets face it people would send the password via a plain text message and make the whole thing rather pointless...

your right the cipher is POINTLESS it has no point in this program and wont be in my final version, I just thought it would be fun way to kill a boring night (i know how sad that sounds)

  • 0

your right the cipher is POINTLESS it has no point in this program and wont be in my final version, I just thought it would be fun way to kill a boring night (i know how sad that sounds)

Writing a Ceaser cipher encrypter/decrypter is acceptable fun (a few years ago I implemented a few algorithms to do brute force decryption and things like frequentist analysis to break things like Affine ciphers).

I think its more that you worry us by writing your own encryption layer AND THEN planning to use it in an actual application. Something that should never need to be done.

  • 0

hello bob, how is you're mother?

could looks like

gyrrq tqt, gqp dz uqi'wy fqmgyw?

Are you sure you even know what a Caesar cipher is? That's not encrypted with a Caesar cipher... a Caesar cipher is a type of substitution cipher where you shift by a constant.

h->g is +1, l->r is +6, o->q is +2... they should be the same... if not, don't call it a Caesar cipher. It's a generic substitution cipher... which, admittedly, is more secure... but so incredibly insecure that it's almost as good as unencrypted. But not the point if you're just having fun :)

Anyway, to answer your question:

char c = 'a';

char c_shifted = (char)((((int)c)+2)%256)

Something along those lines... convert the character to an ASCII value, add a constant (here, 20), then compute the modulus with 256 (assuming 8 bit chars...), then convert back to a char.

  • 0

Are you sure you even know what a Caesar cipher is? That's not encrypted with a Caesar cipher... a Caesar cipher is a type of substitution cipher where you shift by a constant.

h->g is +1, l->r is +6, o->q is +2... they should be the same... if not, don't call it a Caesar cipher. It's a generic substitution cipher... which, admittedly, is more secure... but so incredibly insecure that it's almost as good as unencrypted. But not the point if you're just having fun :)

Anyway, to answer your question:

char c = 'a';

char c_shifted = (char)((((int)c)+2)%256)

Something along those lines... convert the character to an ASCII value, add a constant (here, 20), then compute the modulus with 256 (assuming 8 bit chars...), then convert back to a char.

yes i know what a ceaser cipher is i just used random letters in the example to get my explination across I couldnt be bothered to actually do one for an example

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Source and more 35 years old?! And if my maths is mathing, that means she was around 10 when The Ring came out?! Damn...scariest 10 year old I think I've ever seen. 
    • Adobe Acrobat Reader DC 2026.001.21677 by Razvan Serea Adobe Acrobat Reader DC software is the free, trusted standard for viewing, printing, signing, and annotating PDFs. Its the only PDF viewer that can open and interact with all types of PDF content – including forms and multimedia. It’s connected to Adobe Document Cloud – so you can work with PDFs on computers and mobile devices. Adobe Document Cloud is a revolutionary, modern and efficient way to get work done with documents in the office, at home or on-the-go. At the heart of Document Cloud is the all-new Adobe Acrobat DC, which will take e-signatures mainstream by delivering free e-signing with every individual subscription. Document Cloud includes a set of integrated services that use a consistent online profile and personal document hub. With Adobe Document Cloud, people will be able to create, review, approve, sign and track documents whether on a desktop or mobile device. Businesses will be able to take advantage of Document Cloud for enterprise which provides enterprise-class document services that integrate into systems of record such as CRM, HCM, CLM, and CMS, adding speed, efficiency and transparency to getting business done with documents. Adobe Acrobat Reader DC new feature highlights: Work with PDFs from anywhere with the new, free Acrobat DC mobile app for Android or iOS. Select functionality is also available on Windows Phone. Use the new Fill & Sign tool in your desktop software to complete PDF forms fast with smart autofill. Download the free Adobe Fill & Sign mobile app to add the same option to your iPad or Android tablet device. Save money on ink and toner when printing from your Windows PC. Store and access files in Adobe Document Cloud with 5GB of free storage. Get instant access to recent files across desktop, web, and mobile devices with Mobile Link. Sync your Fill & Sign autofill collection across desktop, web, and iPad devices. Adobe PDF Pack premium features includes: Convert documents and images to PDF files. Use your mobile device camera to take a picture of a paper document or form and convert it to PDF. Turn PDFs into editable Microsoft Word, Excel, PowerPoint, or RTF files. Combine multiple files into a single PDF (web only). Get signatures from others with a complete e-signature service. Send, track, and confirm delivery of documents electronically instead of using fax or overnight services (tracking not available on mobile). Store and access files online with 20GB of storage. Download: Adobe Acrobat Reader DC 64-bit | 719.0 MB (Freeware) Link: Adobe Acrobat Reader DC Home Page | Release Notes | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Everybody will complain, but probably will sell like hotcakes......
    • HONOR launches the HONOR Watch 6 along with early bird discounts and gifts by Steven Parker Global leading AI device ecosystem company HONOR today announced the launch of the HONOR Watch 6. Engineered to unlock your healthiest potential, HONOR Watch 6 is a cutting-edge smartwatch that flawlessly integrates a light and elegant design with professional sports modes and continuous health tracking powered by the latest HONOR AI capability, catering to those who pursue optimal fitness, sports performance, and holistic health. The HONOR Watch 6 is designed to provide professional-grade workout supports and beyond. Featuring a striking Racing Dashboard Design, The HONOR Watch 6 seamlessly draws inspiration from high-performance air intakes to create a visually dynamic and hardcore technological look. Constructed from recyclable aluminum alloy, this device weighs as little as 41 grams​, achieving exceptional lightness and outstanding durability, making it a reliable companion for active everyday wear. The exterior of the smartwatch is accentuated by precision-crafted beveled edges, enhancing its overall three-dimensional visual effect and perfectly blending ultimate hardcore performance with cutting-edge trend expression. Furthermore, the watch's meticulously polished body undergoes an exquisite and delicate sandblasting process, delivering a luxurious texture comparable to titanium alloy and exuding a highly premium tactile experience. Embracing this bold technological aesthetic, the smartwatch caters to modern sensibilities, offering a flawless blend of high-performance design and premium craftsmanship for discerning users. Equipped with an impressive 120+ sports modes, the new smartwatch offers exceptionally comprehensive tracking that truly stands out by bringing professional-grade analysis right to the wrist. Highlighting this elite capability are specialised sports mode for activities like Trail Running, Badminton, and Football. The Trail Running experience places a special focus on outdoor performance, empowering runners with an AI running coach, detailed climbing and distance metrics, and intelligent route deviation alerts, all tracked precisely by the AccuTrack system dual-band six-star GPS. To ensure flawless operation in any environment, the display features advanced water-touch control, guaranteeing the screen reacts perfectly even with wet hands or during rainy scenarios. For court and field sports, the smartwatch delivers professional-level data—such as badminton smash speeds, consecutive rally tracking, and comprehensive football heat and trajectory maps—providing users with advanced insights to elevate their competitive training. Additionally, the HONOR Watch 6 features IP691 water and dust resistance and is powered by a robust 980mAh battery​, the smartwatch claims to deliver extra durability and a remarkable ultra-long battery life of up to 35 days. This exceptional endurance makes it the perfect companion for rigorous outdoor workouts and extended adventures, ensuring users stay active, fully tracked, and continuously supported without the hassle of frequent charging. The HONOR Watch 6 is designed to make advanced health tracking accessible and effortless for everyday life, seamlessly monitoring vital metrics such as heart rate, blood oxygen, stress levels, and sleep cycles.​ Featuring a Quick Health Scan, users can instantly obtain a comprehensive health analysis of key indicators, offering valuable insights into their physical well-being at any time. An automatic daily report delivers a convenient summary every morning to help start the day with a clear understanding, while the all-day health tracking features continuously monitor essential indicators such as body energy, blood oxygen, and sleep cycles, promoting both physical and mental wellness. Supported by the HONOR IntelliSense system—which utilises richer, more uniform signal acquisition than traditional PPG modules—the watch ensures highly precise heart rate and blood flow tracking. Elevating everyday convenience, the new smartwatch features an ultra-bright display reaching 3,000 nits of peak brightness for crystal-clear visibility in direct sunlight. Adding a dynamic level of customisation, the innovative Video Watch Face allows users to set live photos or short videos under 10 seconds as highly personalised, moving backgrounds. Built for maximum efficiency, the device supports dual-phone pairing to centralise notifications from two smartphones, alongside a built-in AI Recorder that automatically generates smart voice notes and summaries for life on the go. Hands-free control is made effortless through intuitive wrist-twist gestures, letting users silence alarms, manage calls, and skip songs without touching the screen. Rounding out the smart experience, advanced NFC integration supports Mastercard and Visa​5, enabling seamless daily payments without the hassle of pre-loading funds. Pricing and Availability The HONOR Watch 6 will be available in Twilight Brown and Shadow Black to suit diverse tastes. Starting from June 18th 2026 customers can purchase the HONOR Watch from £169.99. For more information on availability and purchasing options, please visit the HONOR online store at www.honor.com/uk/. For the first month on-sale, HONOR is offering an early bird discount of £80 in addition to a gift with purchase of HONOR Choice Earbuds Clip, priced in the UK at £59.99. Look out for our review of it, coming in early July.
  • Recent Achievements

    • Week One Done
      Classifyskilleducation earned a badge
      Week One Done
    • One Month Later
      eurospharma62 earned a badge
      One Month Later
    • Week One Done
      With What earned a badge
      Week One Done
    • Week One Done
      Harris Gilbert earned a badge
      Week One Done
    • One Month Later
      Vincian earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      546
    2. 2
      +Edouard
      172
    3. 3
      PsYcHoKiLLa
      79
    4. 4
      ATLien_0
      64
    5. 5
      neufuse
      64
  • Tell a friend

    Love Neowin? Tell a friend!