Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7697195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:57:17+00:00 2026-05-31T21:57:17+00:00

I was doing a simple c++ chat and i wanted to encrypt the messages

  • 0

I was doing a simple c++ chat and i wanted to encrypt the messages with a simple made code.
So i thought it would be like chars a-x and then it would replace them for example a -11.
So it would need to

  1. Split the message into chars
  2. Change the chars into number
  3. Put them back in the right order.

So does anyone knows how to do it?
Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:57:18+00:00Added an answer on May 31, 2026 at 9:57 pm

    std::string will store arbitrary values of char, and let you access individual characters quite easily. For encryption, however, you might prefer to work with unsigned char, which is pretty easy too — std::string is just a typedef for std::basic_string<char>, but std::basic_string<unsigned char> is pretty easy to manage.

    It sounds like what you want is on the order of a Ceaser cipher, though it’s easiest if you just “encrypt” everything, rather than just letters.

    std::basic_string<unsigned char> s;
    
    for (int i=0; i<s.length(); i++)
        s[i] += 5;
    

    Then to “decrypt” you’d just do the opposite:

    for (int i=0; i<s.length; i++)
        s[i] -= 5;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build a simple web-interface application that can send/receive chat messages to/from
I am doing simple formatting for an email with StringBuilder and have code that
I am doing a simple chat application and I want to show balloons similar
I'm doing a simple chat. When user sends message to server I want to
I'm doing a simple chat script and I have the killSession function which kills
i have a simple chat and the way i do thinks now is like
Would you say this is the most optimal way of doing simple traditional logging
A lot of a particular C# WinForms app I've seen is code doing simple
I'm doing simple string input parsing and I am in need of a string
I am doing simple forms authentication for a small ASP.NET (3.5, C#) application and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.