Está en la página 1de 2

/*

* To change this license header, choose License Headers in Project Properties.


* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author Estudiante
*/
public class Encriptar
{
private int factor;
private String mensaje;
private String mensajeCifrado;

private char[] Caracteres = mensaje.toCharArray();


private int tamao = mensaje.length();

public static void main(String[] args) {


Encriptar encriptar;

public String encriptar(String mensaje){


char array[] =mensaje.toCharArray();
for (int i = 0; i < array.length; i++) {
array[i] = (char)(array[i]+(char)6);
}
encriptado=String.valueOf(array);
System.out.println(encriptado);
return encriptado;
}

for

(int i = 0; i < tamao; i++)

{
//echo $arreglo[$i];
caracteres[i] = char(codePointAt(caracteres[i]) + (factor-1));
System.out.println(caracteres[i]);
}
}

También podría gustarte