Forum Discussion

cobra27's avatar
cobra27
Occasional Contributor
10 years ago

RSA Encrypt Script TC 11.20

Hallo,

I need to crypt a number with the rsa Crypting key.

There is some code that can I used?

 

I've search in Internet but there are nothing for TC and vbscript.

 

I can use any scripting lenguage.

 

Thank you!

6 Replies

  • Hi,


    We don't have such code snippet. However, since RSA is an algorithm, it can be implemented on any language. This article contains the sample code on JavaScript. TC supports JScript, which has the very similar syntax. You can try modifying this sample.


    Also, I have found the sample on Python.

  • cobra27's avatar
    cobra27
    Occasional Contributor

    thankyou for reply.

     

    In TC it's possible create a project in VBscript and include a phyton / Jscript script?

     

    thankyou!

    • AlexKaras's avatar
      AlexKaras
      Icon for Champion Level 2 rankChampion Level 2

      Hi,

       

      No, this is not possible. The project in TC must use the same language trouhgout all test code.

      But it is possible to create Script Extension using either VBScript or JScript and call it from any script language.

       

      P.S. A similair approach is to implement the needed functionality using any 'regular' language (C/C++ / Delphi) as a function in a dll and call this dll function from TC test code.

  • cobra27's avatar
    cobra27
    Occasional Contributor

    Hi,

     

    thankyou for the answer.

     

    My problem is that I have a Public key in a .pub file, and there are nothing to used this file.

     

    I need to use the .pub file, encrypt the credit card and send a HTTP message.

     

    The .pub file is same

     

    -----BEGIN CERTIFICATE-----
    A7076ABDAF672F32BC0D29FF25D8E029504946E5F4D127AECC0E05234E3C72BB2C4AD5282E2FF96D687F9FB933D42CA835A710BE502A436C18B36EAEB657DCDD6F33F637D7C597BC3BFF131CF3BC001CBCE8B83F55B674E533C7A82E570226EA7EE45A6AA

    -----END CERTIFICATE-----

     

    any idea?

    • AlexKaras's avatar
      AlexKaras
      Icon for Champion Level 2 rankChampion Level 2

      Hi,

       

      What is your actual task? Why do you need to encrypt manually?

       

      > I've search in Internet but there are nothing for TC and vbscript.

      Did you find something for C/C++/Delphi/Pascal/Java/.Net ?

      If yes, than there are the chances that you can call corresponding methods from native DLLs/JARs/assemblies using the means provided by TestComplete.

       

      > [...] send a HTTP message

      Are you testing some web page? If yes, you may consider calling page code that performs encryption from TestComplete (https://support.smartbear.com/viewarticle/69056/)

       

       

      • cobra27's avatar
        cobra27
        Occasional Contributor

        Hi,

         

        What is your actual task? Why do you need to encrypt manually?

         

        Hi, I'm testing a server with a credit cart number crypting by RSA pub key. We have a lot of partner with accept anyone a different number.

         

        > I've search in Internet but there are nothing for TC and vbscript.

        Did you find something for C/C++/Delphi/Pascal/Java/.Net ?

        If yes, than there are the chances that you can call corresponding methods from native DLLs/JARs/assemblies using the means provided by TestComplete.

         

        No, I've not found. The problem is used my PUB key (with the format in a previews reply) and encript the card.

        Now I think to use a JAR file, and lunch this by a shell, and capture thre result in a txt file.

         

        But I've not a java script, and the JDK (I'm not developer but only tester).

         

         

        > [...] send a HTTP message

        Are you testing some web page? If yes, you may consider calling page code that performs encryption from TestComplete (https://support.smartbear.com/viewarticle/69056/)

         

         No it's a http service to recharge the credit card. And for the PCI, the credit card mast send crypting.

         

        Regards,
        Alex
        [Community Expert Group]
         
        Regards,
        Stefano