Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 29-11-2022
DarkSton DarkSton is offline
Miembro
 
Registrado: jun 2017
Posts: 64
Poder: 10
DarkSton Va por buen camino
c a delphi7

hola comunidad encontre este codigo AES
Código PHP:
private static byte[] AesEncryptBlock(byte[] plainText, byte[] Key)
        {
            
byte[] output_buffer = new byte[plainText.Length];

            
using (AesManaged aesAlg = new AesManaged())
            {
                
aesAlg.Mode = CipherMode.ECB;

                
aesAlg.BlockSize = 128;
                
aesAlg.KeySize = 128;
                
aesAlg.Padding = PaddingMode.None;
                
aesAlg.Key = Key;

                
// Create a encryptor to perform the stream transform.
                
ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);
                
encryptor.TransformBlock(plainText, 0, plainText.Length, output_buffer, 0);
            }

            return 
output_buffer;
        }

        
// not used, but nice to have around
        
private static byte[] AesDecryptBlock(byte[] cipherText, byte[] Key)
        {
            
byte[] output_buffer = new byte[cipherText.Length];

            
using (AesManaged aesAlg = new AesManaged())
            {
                
aesAlg.Mode = CipherMode.ECB;

                
aesAlg.BlockSize = 128;
                
aesAlg.KeySize = 128;
                
aesAlg.Padding = PaddingMode.None;
                
aesAlg.Key = Key;

                
// Create a decryptor to perform the stream transform.
                
ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
                
decryptor.TransformBlock(cipherText, 0, cipherText.Length, output_buffer, 0);
            }
            return 
output_buffer;
        }

        static 
string GLParameters(string username, string password)
        {
            
// final block (unknown) looks like 4 DWORDs, first one being always zero, second always nonzero, third and fourth are occasionally zero
            
List<byte> result = new List<byte>();
            
byte[] key = { 0xFA, 0xEE, 0x85, 0xF2, 0x40, 0x73, 0xD9, 0x16, 0x13, 0x90, 0x19, 0x7F, 0x6E, 0x56, 0x2A, 0x67 };
            
byte[] finalBlock = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            
result.AddRange(AesEncryptBlock(StringToBytes(username, 16), key));
            
result.AddRange(AesEncryptBlock(StringToBytes(password, 16), key));
            
result.AddRange(AesEncryptBlock(finalBlock, key));
            return 
BitConverter.ToString(result.ToArray()).Replace("-", "").ToUpper();
        } 
como puedo pasarlo a delphi7
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
donde puedo comprar libros en mexico, la biblia de delphi7 y mastering delphi7? sakuragi Varios 30 12-02-2013 18:37:51
pantallas en delphi7 kiozo Varios 1 09-06-2010 23:09:10
TMS y Delphi7 Troffed Varios 3 24-05-2006 11:38:56
vararrayof en Delphi7 jatorve Conexión con bases de datos 1 14-03-2005 11:00:47
Compilación Delphi7 jatorve Varios 3 08-03-2005 21:38:39


La franja horaria es GMT +2. Ahora son las 09:28:07.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi