Jump to content

huayan889

uniGUI Subscriber
  • Posts

    99
  • Joined

  • Last visited

Posts posted by huayan889

  1. 6 minutes ago, Sherzod said:

    You can use it like this:

    
    Uses ... IdHash, IdHashMessageDigest;
    
    with TIdHashMessageDigest5.Create do
    try
      MD5HashStr :=  HashStringAsHex(edPass.Text);
    finally
      Free;
    end;

     

    MD5 is just an example, I need to use other encryption algorithms

  2. 15 minutes ago, huayan889 said:

    It's OK to assign a value to the control, but now I want to return the result to the specified variable

    Something like this,Delphi Code call js MD5 function,  Can it be realized?

    UniQuery1.SQL.Text := 'select * from ss_customer_info where (customer_id=' + chr(39) +
        UniEdit1.Text + chr(39) + ') and  (admin_id =' + chr(39) + admin_id.Text + chr(39) +
        ') and  (admin_pass=' + chr(39) + MD5(fromCode(FpKey)) + chr(39) + ')';
      UniQuery1.Open;
     

  3. How to Get JS function ADD(10,2) result?

    procedure TMainForm.UniFormCreate(Sender: TObject);
    begin
      Script.text:=
      'function add(x,y) {'+
      ' return x+y;' +
      '}';

    showmessageN(add(10,2));//display result= 12
    end;

  4. Thanks irigsoft, it has been solved. According to your method, ssleay32.dll and libeay32.dll need to use the latest version.

    UniServerModule:

    function GetCipherList(AStrength: Integer): WideString;
    const
      cCIPHER_LIST_1: WideString = 'DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256';
      cCIPHER_LIST_2: WideString = 'DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256';
      cCIPHER_LIST_3: WideString = 'ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA';
      cCIPHER_LIST_4: WideString = 'AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA';
      cCIPHER_LIST_5: WideString = 'DES-CBC3-SHA';

    begin
      case AStrength of
        // Advanced Plus (A+)
          1: Result := cCIPHER_LIST_1;
        // Advanced (A)
          2: Result := cCIPHER_LIST_1 + ':' + cCIPHER_LIST_2;
        // Broad Compatibility (
          3: Result := cCIPHER_LIST_1 + ':' + cCIPHER_LIST_2 + ':' + cCIPHER_LIST_3;
        // Widest Compatibility (C)
          4: Result := cCIPHER_LIST_1 + ':' + cCIPHER_LIST_2 + ':' + cCIPHER_LIST_3 + ':' + cCIPHER_LIST_4;
        // Legacy (C-)
          5: Result := cCIPHER_LIST_1 + ':' + cCIPHER_LIST_2 + ':' + cCIPHER_LIST_3 + ':' + cCIPHER_LIST_4 + ':' + cCIPHER_LIST_5;
        else
          Result := EmptyStr;
      end;
    end;

    procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
    begin
      UniServerModule.SSL.SSLOptions.CipherList := GetCipherList(5);

    end;

    image.png.23ad05be2cea5250074b8f1a17f2f437.png

    image.thumb.png.5c789895e0363a9b012f6c6f9a5e03e3.png

    ssleay32.dll libeay32.dll

    • Like 1
  5. 8 minutes ago, irigsoft said:

    Yes it is .

    But when you use older versions of TLS they will not work. You have to try this in mind.

    Mozzila have explained very well, I have no methods to try, maybe with some api to your server with tls 1.0 or older will show that I'm right.

    I have to disable the old version of TLS

  6. 18 minutes ago, Sherzod said:

    Hello,

    Try this code:

    
    procedure TMainmForm.UnimFormCreate(Sender: TObject);
    begin
      //UnimButton1.ClientEvents.ExtEvents.Values['tap'] :=
      //'function tap(sender, e, eOpts)' +
      //'{'+
      //'  document.getElementsByName("' + uniMEdit1.JSName+'")[0].value = MD5 (document.getElementsByName("' +
      //uniMEdit1.JSName +'")[0].value);'+
      //'}';
      
      UnimButton1.JSInterface.JSAddListener('tap', 'function(){'+ UnimEdit1.JSName +'.setValue(MD5('+ UnimEdit1.JSName +'.getValue()))}');
    end;

     

    thank Sherzod,That's what I want.

×
×
  • Create New...