Ask Experts Questions for FREE Help !
Ask
    Mimypooh's Avatar
    Mimypooh Posts: 1, Reputation: 1
    New Member
     
    #1

    Feb 15, 2014, 03:52 AM
    How to do encryption for char using java?
    public String getEncryption(String text){
    String x = "";

    for(int i = 0; i < text.length(); i++){
    String sub = text.substring(i, i+1);
    System.out.println(i + " = " + sub);
    String en = encrypt_code[Integer.parseInt(sub)];
    System.out.println("Result:" + en);
    x = x.concat(en);
    }
    return x;
    }

    how do I convert this to charAt?
    I have this so far:

    public String getEncryption2(String text){
    String x = "";


    for(int I = 0; I < text.length(); I++){

    char ch = text.charAt(I);

Check out some similar questions!

Char input problems [ 1 Answers ]

Why when I try to compile , it says "variable ch is already defined in method main(java.lang.String)"? I have probkems getting char inputs. import java.util.Scanner; public class Tolak{ public static void main(String args) { int correct=0; char ch;

Char[] array insert [ 0 Answers ]

Hey I was just wondering how I would solve this, I have tried many options but none of them seem to work, I have commented in what I actually need done, would someone please be able to help me? Public class StringImproved { char content; public boolean insert(java.lang.String...

Using C++ (if, char or Boolean) [ 0 Answers ]

Using C++ (if, char or Boolean) Write a program that asks the user for a two digit number and then prints the English word for that number. Sample run: Enter a two-digit number: 45 You entered the number forty-five. PLAN: Read the number entered as an integer and then break the number up...

How to set up WPA encryption? [ 5 Answers ]

:confused: Hi. My desktop is connected to the internet through a wireless modem/router. I use WEP encryption protocol to secure my network, but recently I found out that this protocol is easy to be hacked (some guys with the appropriate equipment hacked this encryption in about 3 min!). So, I...

Encryption of passwords [ 14 Answers ]

Hi guys, Hello every one I was wondering if the passwords we enter Yahoo messenger or Yahoo mail are straight away encrypted because when I was trying to sniff my networks traffic 4 passwords I was hardly able to make out something and also I would like to suggest me some nice...


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.