thefiddle47 Posted May 25, 2014 at 02:03 PM Report #556911 Posted May 25, 2014 at 02:03 PM Alguém me pode explicar como codificar uma string em C#?
nelsonr Posted May 25, 2014 at 02:27 PM Report #556913 Posted May 25, 2014 at 02:27 PM Encriptar? Tens aqui um exemplo: http://www.deltasblog.co.uk/code-snippets/basic-encryptiondecryption-c/
thefiddle47 Posted May 25, 2014 at 03:21 PM Author Report #556914 Posted May 25, 2014 at 03:21 PM eu queria encriptar com uma chave minha
nelsonr Posted May 25, 2014 at 03:24 PM Report #556915 Posted May 25, 2014 at 03:24 PM Viste o link que coloquei?
thefiddle47 Posted May 25, 2014 at 03:28 PM Author Report #556916 Posted May 25, 2014 at 03:28 PM (edited) vi mas a key é como? podes dar um exemplo sff? Edited May 25, 2014 at 03:29 PM by thefiddle47
nelsonr Posted May 25, 2014 at 06:22 PM Report #556927 Posted May 25, 2014 at 06:22 PM A encriptação nesse exemplo precisa de uma chave de 24 carateres de tamanho (neste exemplo uso xpto12345678901234567890) string textoEncriptado = Encryption.Encrypt("Portugal a programar", "xpto12345678901234567890"); Console.Write(textoEncriptado); // "2xNPwPwMSL1cnBAqqTOhscuKgccqldIP" string textoDescriptado = Encryption.Decrypt(textoEncriptado, "xpto12345678901234567890"); Console.Write(textoEncriptado); // "Portugal a programar"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now