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

  • SEARCH
  • Home
  • 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 8735005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:57:25+00:00 2026-06-13T09:57:25+00:00

I with my beginner skils in Java, can’t figure out how to encrypt text.

  • 0

I with my beginner skils in Java, can’t figure out how to encrypt text. Yes I do know that there are alot of libraries and APIS, but this time I want to do this ny way so I understand everything perfectly.

So my idea and question is how to assign values to characters and later use them (encrypt and decrypt). For example A = 12; B = 13; C = 14; D = 15. So DBAC would be 15131214

So far I made this program that just increases character by one, but I cant figure out how to assign diferent values.

package javaapplication2;

public class JavaApplication2 {
public static void main(String[] args) {
    int b;
    String text = "criptable text";
    char[] textArray = text.toCharArray();

    for(int index=0; index < textArray.length;index++){
        textArray[index]++;

    }

    String done = new String (textArray);
    System.out.println(done);
}
}
  • 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-06-13T09:57:26+00:00Added an answer on June 13, 2026 at 9:57 am

    You might be looking for something like this?

    public class TestType {
    
    public static void main(String[] args) {
    
        /*
         * Create a Map of replacements
         */
        Map<Character, String> keyMap = new HashMap<Character, String>();
        keyMap.put('a', "12");  keyMap.put('b', "13");
        keyMap.put('c', "14");  keyMap.put('d', "15");
        keyMap.put('e', "16");  keyMap.put('f', "17");
        keyMap.put('g', "18");  keyMap.put('h', "19");
        //Add more key-values for all letter support
    
    
        String plainText = "abcdefgh";
        StringBuffer encrypted = new StringBuffer();
    
        for (char ch : plainText.toCharArray()) {
            /* Form the encrypted string */
            encrypted.append(keyMap.get(ch));
    
        }
    
        System.out.println("Encrypted: " + encrypted.toString());
    
    }
    

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a beginner-verging-on-intermediate rails developer that is working hard to improve my skills.
Beginner here trying to get a pipeline working in bash. If somebody can see
Beginner in Android development. My code crashes. I have made a simple Java method
Beginner level question Scenario: Have simple string cocantation tool, that I might expand later
Beginner question here. I'm going to make a Jquery function that is used to
I have two questions - I'm a beginner in Java but have a huge
Hey, I'm a beginner in Objective C, and my .NET and Java years have
Beginner programmer here....hope it makes sense :) I have created a console app that
I'm a complete beginner trying to learn Java as my first language. When I'm
I'm have beginner skills and am hoping someone can help me with a complex

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.