Find Jobs
Hire Freelancers

Create PHP Decrypt function

$10-30 USD

Terminado
Publicado hace más de 9 años

$10-30 USD

Pagado a la entrega
Hello, I have this class in JAVA, with 2 methods: criptografar AND descriptografar. I need an equivalent class in PHP code to use in a website. This 2 methods must do the same thing in JAVA (done) and PHP (pendent). thank you ---------------------- import [login to view URL]; import java.security.spec.*; import javax.crypto.*; import javax.crypto.spec.*; public class UtilCriptografia implements Serializable { private static byte[] hexToBytes(String str) { if (str == null) { return null; } else if ([login to view URL]() < 2) { return null; } else { int len = [login to view URL]() / 2; byte[] buffer = new byte[len]; for (int i = 0; i < len; i++) { buffer[i] = (byte) [login to view URL]( [login to view URL](i * 2, i * 2 + 2), 16); } return buffer; } } private static String bytesToHex(byte[] data) { if (data == null) { return null; } else { int len = [login to view URL]; String str = ""; for (int i = 0; i < len; i++) { if ((data[i] & 0xFF) < 16) { str = str + "0" + [login to view URL](data[i] & 0xFF); } else { str = str + [login to view URL](data[i] & 0xFF); } } return [login to view URL](); } } public static String criptografar(String valueLimpo, String theKEY) { byte[] theKey = null; byte[] theMsg = null; byte[] theCph = null; try { theKey = hexToBytes(theKEY); theMsg = hexToBytes(valueLimpo); KeySpec ks = new DESKeySpec(theKey); SecretKeyFactory kf = [login to view URL]("DES"); SecretKey ky = [login to view URL](ks); Cipher cf = [login to view URL]("DES/ECB/NoPadding"); [login to view URL](Cipher.ENCRYPT_MODE, ky); theCph = [login to view URL](theMsg); } catch (Exception e) { [login to view URL](); } return bytesToHex(theCph); } public static String descriptografar(String valueDES, String theKEY) { byte[] theKey = null; byte[] theMsg = null; byte[] theCph = null; try { theKey = hexToBytes(theKEY); theMsg = hexToBytes(valueDES); KeySpec ks = new DESKeySpec(theKey); SecretKeyFactory kf = [login to view URL]("DES"); SecretKey ky = [login to view URL](ks); Cipher cf = [login to view URL]("DES/ECB/NoPadding"); [login to view URL](Cipher.DECRYPT_MODE, ky); theCph = [login to view URL](theMsg); } catch (Exception e) { [login to view URL](); } return bytesToHex(theCph); } }
ID del proyecto: 6872065

Información sobre el proyecto

3 propuestas
Proyecto remoto
Activo hace 9 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Hello. I have 2 years experience in commericla Web Development and can start working on it immediantly. Please, let me know if you want to work with me.
$30 USD en 1 día
5,0 (8 comentarios)
4,1
4,1
3 freelancers están ofertando un promedio de $35 USD por este trabajo
Avatar del usuario
A proposal has not yet been provided
$50 USD en 2 días
4,9 (92 comentarios)
5,3
5,3
Avatar del usuario
!! Ready for Trail Job to proof my skills !! I have experience in Web Development around 8+ years with expertise on Java, PHP, MYSQL, SugarCRM, vTiger, WordPress, Opencart, Magento, Drupal, Codeignitor, HTML, CSS, JavaScript, Ajax Development etc. My service are like development of Drupal, Wordpress, Codeignitor web application, creation of new website, make website sites responsive. Each last job have been done with quality and bug free. My mission and objective is give such service to clients so that he want more with you. Why you should hire me? - Availability- 45 hrs/week Flexible with All Time Zones. - Quality Service under your budget. - Quality Online Support. - Reports- Daily Detailed Reports, Weekly and Monthly Reports with needed everything.
$25 USD en 1 día
5,0 (3 comentarios)
2,8
2,8

Sobre este cliente

Bandera de BRAZIL
So Paulo, Brazil
5,0
5
Forma de pago verificada
Miembro desde may 4, 2012

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.