Ver Mensaje Individual
  #4  
Antiguo 07-01-2015
YosvanyRL YosvanyRL is offline
Miembro
 
Registrado: may 2012
Posts: 60
Reputación: 15
YosvanyRL Va por buen camino
Aun las letras chinas...

Gracias por responder tan rapido porque realmente lo necesito. Con relacion a las letras chinas que me salen. He cambiado la funcion para cifrar texto por la siguiente que es el Advanced Encryption Standar
Código Delphi [-]
function cifrarTexto (Str, Clave : String) : String;
var
  Src: TStringStream;
  Dst: TMemoryStream;
  Size: Integer;
  Key: TAESKey;
  ExpandedKey: TAESExpandedKey;
begin
  Result:= EmptyStr;
  Src:= TStringStream.Create(Str);
  try
    Dst:= TMemoryStream.Create;
    try
      // Preparamos la clave, lo ideal es que tenga 32 caracteres
      FillChar(Key,Sizeof(Key),#0);
      if Length(Clave) > Sizeof(Key) then
        move(PChar(Clave)^,Key,Sizeof(key))
      else
        move(PChar(Clave)^,Key,Length(Clave));
      EsExpandKey(ExpandedKey,Key);
      // Guardamos el tamaño del texto original
      Size:= Src.Size;
      Dst.WriteBuffer(Size,Sizeof(Size));
      // Ciframos el texto
      AESEncryptStreamECB(Src,Dst,ExpandedKey);
      // Lo codificamos a base64
      Result:= BinToStr(Dst.Memory,Dst.Size);
    finally
      Dst.Free;
    end;
  finally
    Src.Free;
  end;
end;
Y me siguen saliendo las letras chinas.

Cambie el siguiente codigo de la funcion
Código Delphi [-]
function cifrarTexto (Str, Clave : String) : String;
por
Código Delphi [-]
function cifrarTexto (Str, Clave : AnsiString) : AnsiString;

y ahora me sale ??????????????????????????? en vez de las letras chinas

Please, que es ese fantasma chino que me atormenta?

Última edición por nlsgarcia fecha: 07-01-2015 a las 05:19:57. Razón: Identación y Sintaxis Delphi
Responder Con Cita