Ankündigung

Einklappen
Keine Ankündigung bisher.

[Erledigt] Steam Login via curl

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • [Erledigt] Steam Login via curl

    PHP RSA Verschlüsselung

    Ich habe schon mal einen ähnlichen Thread erstellt, bin aber vermutlich falsch an das Problem herangegangen. Ich bin jetzt kein Javascript Talent, brauche aber diesen Javascript Code in PHP. (Es geht darum, dass ich einen Login auf der Seite http://steampowered.com mit PHP simulieren will)
    Es reicht aber nicht aus die Daten einfach mit einen POST Request an die Seite zu senden. Das Passwort muss davor noch mit einen RSA Verfahren verschlüsselt werden.
    Es geht wie oben schon genannt darum einen Text mit dem RSA Verfahren zu verschlüsseln.
    Man bekommt aus einer Datei den publickey_exponent und den publickey_modulus. Mit diesen zwei Zahlen wird dann der Text verschlüsselt. Ich habe schon ein paar Ansätze, aber keins davon funktioniert.

    Javascript:
    In dieser Datei sind die Funktionen die für den Login verwendet werden. Wenn man sich anmeldet wird als erstes die Funktion DoLogin() aufgerufen. Diese holt aus einer Datei den PublicKey modulus und exponent. Danach wird das Passwort mit diesen 2 Zahlen verschlüsselt und an die Datei gesendet, die überprüft ob der Login richtig ist.
    Hier ist der Quellcode der Datei mit den Funktionen:
    PHP-Code:

    //Used to add a unique get var to all ajax calls, so IE doesn't do stupid caching
    var iAjaxCalls 0;

    var 
    iIncorrectLoginFailures 0;

    function 
    HighlightFailuremsg )
    {
        var 
    errorDisplay = $('error_display');
        if ( 
    errorDisplay )
        {
            
    errorDisplay.updatemsg );
            
    errorDisplay.show();
            
    errorDisplay.style.color '#ffffff';
                    try { 
                new 
    Effect.Morph'error_display', { style'color: #d0434b' } );
            }
            catch(
    err) { }
                }
    }


    //Refresh the catpcha image 
    function RefreshCaptcha()
    {
        ++
    iAjaxCalls;

            new 
    Ajax.Request('https://steamcommunity.com/actions/RefreshCaptcha/',
          {
            
    method:'get',
            
    parameters: { count iAjaxCalls },
            
    onSuccess: function(transport){
              if ( 
    transport.responseText ){
                
                try {
                    var 
    result transport.responseText.evalJSON(true);
                  } catch ( 
    ) {
                  
    //alert(e);
                    
    return;
                  }
                  
                  
    gid result.gid;
                  
    UpdateCaptchagid );
              }
            }
          });
    }

    function 
    UpdateCaptchagid )
    {
        if ( 
    gid != -
        {
            $(
    'captcha_entry').show();
            $(
    'captchaImg').src 'https://steamcommunity.com/public/captcha.php?gid='+gid;
                        $(
    'input_captcha').value='';
                }
        $(
    'captchagid').value gid;
    }

    var 
    g_bLoginInFlight false;
    var 
    g_bInEmailAuthProcess false;
    var 
    g_bInTwoFactorAuthProcess false;
    var 
    g_bEmailAuthSuccessful false;
    var 
    g_bLoginTransferInProgress false;
    var 
    g_bEmailAuthSuccessfulWantToLeave false;
    var 
    g_bTwoFactorAuthSuccessful false;
    var 
    g_bTwoFactorAuthSuccessfulWantToLeave false;
    var 
    g_sOAuthRedirectURI 'steammobile://mobileloginsucceeded';
    var 
    g_sAuthCode "";

    function 
    DoLogin()
    {
        var 
    form document.forms['logon'];

        var 
    username form.elements['username'].value;
        
    username username.replace( /[^\x00-\x7F]/g'' ); // remove non-standard-ASCII characters

        
    var password form.elements['password'].value;
        
    password password.replace( /[^\x00-\x7F]/g'' ); // remove non-standard-ASCII characters

        
    if ( g_bLoginInFlight || password.length == || username.length == )
            return;

        
    g_bLoginInFlight true;
        $(
    'login_btn_signin').hide();
        $(
    'login_btn_wait').show();

        new 
    Ajax.Request'https://steamcommunity.com/login/getrsakey/',
            {
                
    method'post',
                
    parameters: {
                    
    usernameusername,
                    
    donotcache: ( new Date().getTime() )
                },
                
    onSuccessOnRSAKeyResponse,
                
    onException: function( req) {
                    throw 
    e;
                }
            }
        );
    }


    function 
    getAuthCoderesults )
    {
                var 
    authCode g_sAuthCode;
            
    g_sAuthCode '';
            return 
    authCode;
        }

    function 
    OnRSAKeyResponsetransport )
    {
        var 
    results transport.responseJSON;
        if ( 
    results.publickey_mod && results.publickey_exp && results.timestamp )
        {
            var 
    form document.forms['logon'];

            var 
    pubKey RSA.getPublicKeyresults.publickey_modresults.publickey_exp );
            var 
    username form.elements['username'].value;
            
    username username.replace( /[^\x00-\x7F]/g'' ); // remove non-standard-ASCII characters
            
    var password form.elements['password'].value;
            
    password password.replace( /[^\x00-\x7F]/g'' ); // remove non-standard-ASCII characters
            
    var encryptedPassword RSA.encryptpasswordpubKey );

            new 
    Ajax.Request'https://steamcommunity.com/login/dologin/',
                {
                    
    method'post',
                    
    parameters: {
                        
    passwordencryptedPassword,
                        
    usernameusername,
                        
    twofactorcodegetAuthCoderesults ),
                        
    emailauthform.elements['emailauth'].value,
                        
    loginfriendlynameform.elements['loginfriendlyname'].value,
                                            
    captchagidform.elements['captchagid'].value,
                        
    captcha_textform.elements['captcha_text'].value,
                        
    emailsteamidform.elements['emailsteamid'].value,
                        
    rsatimestampresults.timestamp,
                        
    remember_login: ( form.elements['remember_login'] && form.elements['remember_login'].checked ) ? 'true' 'false',
                        
    donotcache: ( new Date().getTime() )
                    },
                    
    onSuccessOnLoginResponse,
                    
    onException: function( req) {
                                throw 
    e;
                            }
                }
            );
        }
        else
        {
            if ( 
    results.message )
            {
                
    HighlightFailureresults.message );
            }

            $(
    'login_btn_signin').show();
            $(
    'login_btn_wait').hide();

            
    g_bLoginInFlight false;
        }
    }

    function 
    OnLoginResponsetransport )
    {
        var 
    results transport.responseJSON;
        
    g_bLoginInFlight false;
        var 
    bRetry true;

        if ( 
    results.login_complete )
        {

            var 
    bRunningTransfer false;
            if ( 
    results.transfer_url && results.transfer_parameters )
            {
                
    bRunningTransfer true;
                
    TransferLoginresults.transfer_urlresults.transfer_parameters );
            }

            if ( 
    g_bInEmailAuthProcess )
            {
                
    g_bEmailAuthSuccessful true;
                
    SetEmailAuthModalState'success' );
            }
            else if ( 
    g_bInTwoFactorAuthProcess )
            {
                
    g_bTwoFactorAuthSuccessful true;
                
    SetTwoFactorAuthModalState'success' );
            }
            else
            {
                
    bRetry false;
                if ( !
    bRunningTransfer )
                    
    LoginComplete();
            }
        }
        else
        {
            if ( 
    results.requires_twofactor )
            {
                $(
    'captcha_entry').hide();

                if ( !
    g_bInTwoFactorAuthProcess )
                    
    StartTwoFactorAuthProcess();
                else
                    
    SetTwoFactorAuthModalState'incorrectcode' );
            }
            else if ( 
    results.captcha_needed && results.captcha_gid )
            {
                
    UpdateCaptcharesults.captcha_gid );
                
    iIncorrectLoginFailures ++;
            }
            else if ( 
    results.emailauth_needed )
            {
                if ( 
    results.emaildomain )
                    $(
    'emailauth_entercode_emaildomain').updateresults.emaildomain );

                if ( 
    results.emailsteamid )
                    $(
    'emailsteamid').value results.emailsteamid;

                if ( !
    g_bInEmailAuthProcess )
                    
    StartEmailAuthProcess();
                else
                    
    SetEmailAuthModalState'incorrectcode' );
            }
            else if ( 
    results.denied_ipt )
            {
                $(
    'loginIPTModal').OnModalDismissal ClearLoginForm;
                
    showModal'loginIPTModal' );
            }
            else
            {
                
    iIncorrectLoginFailures ++;
            }

            if ( 
    results.message )
            {
                
    HighlightFailureresults.message );
                        }
        }
        if ( 
    bRetry )
        {
            $(
    'login_btn_signin').show();
            $(
    'login_btn_wait').hide();
        }
    }

    function 
    ClearLoginForm()
    {
        var 
    rgElements document.forms['logon'].elements;
        
    rgElements['username'].value '';
        
    rgElements['password'].value '';
        
    rgElements['emailauth'].value '';
        
    rgElements['emailsteamid'].value '';
        $(
    'authcode').value '';

        if ( 
    rgElements['captchagid'].value )
            
    RefreshCaptcha();

        
    rgElements['username'].focus();
    }

    function 
    StartEmailAuthProcess()
    {
        
    g_bInEmailAuthProcess true;

        
    SetEmailAuthModalState'entercode' );

                $(
    'loginAuthCodeModal').OnModalDismissal CancelEmailAuthProcess;
            
    showModal 'loginAuthCodeModal'true );
        }

    function 
    CancelEmailAuthProcess()
    {
        
    g_bInEmailAuthProcess false;
        
    // if the user closed the auth window on the last step, just redirect them like we normally would
        
    if ( g_bEmailAuthSuccessful )
            
    LoginComplete();
        else
            
    ClearLoginForm();
    }

    function 
    TransferLoginurlparameters )
    {
        if ( 
    g_bLoginTransferInProgress )
            return;
        
    g_bLoginTransferInProgress true;

            var 
    iframeElement document.createElement'iframe' );
        
    iframeElement.id 'transfer_iframe';
        var 
    iframe = $( iframeElement );
        
    iframe.hide();
        $(
    document.body).appendChildiframe );

        var 
    doc iframe.contentWindow.document;
        
    doc.open();
        
    doc.write'<form method="POST" action="' url '" name="transfer_form">' );
        for ( var 
    param in parameters )
        {
            
    doc.write'<input type="hidden" name="' param '" value="' parameters[param] + '">' );
        }
        
    doc.write'</form>' );
        
    doc.write'<script>window.onload = function(){ document.forms["transfer_form"].submit(); }</script>' );
        
    doc.close();

        
    // firefox fires the onload event twice
        
    var cLoadCount Prototype.Browser.Gecko 1;

        
    Event.observeiframe'load', function( event ) { if ( --cLoadCount == OnTransferComplete() } );
        
    Event.observeiframe'error', function( event ) { OnTransferComplete(); } );

        
    // after 10 seconds, give up on waiting for transfer
        
    window.setTimeoutOnTransferComplete10000 );
    }

    function 
    OnTransferComplete()
    {
        if ( !
    g_bLoginTransferInProgress )
            return;
        
    g_bLoginTransferInProgress false;
        if ( !
    g_bInEmailAuthProcess && !g_bInTwoFactorAuthProcess )
            
    LoginComplete();
        else if ( 
    g_bEmailAuthSuccessfulWantToLeave || g_bTwoFactorAuthSuccessfulWantToLeave)
            
    LoginComplete();
    }

    function 
    OnEmailAuthSuccessContinue()
    {
        if ( 
    g_bLoginTransferInProgress )
        {
                                $(
    'auth_buttonsets').childElements().invoke('hide');
                if ( $(
    'auth_buttonset_waiting') )
                    $(
    'auth_buttonset_waiting').show();

            
    g_bEmailAuthSuccessfulWantToLeave true;
        }
        else
            
    LoginComplete();
    }

    function 
    LoginComplete()
    {
            if ( $(
    'openidForm') )
        {
            $(
    'openidForm').submit();
        }
        else
        {
                    {
                
    window.location document.forms['logon'].elements['redir'].value;
            }
        }
    }

    function 
    SubmitAuthCodedefaultFriendlyNameText )
    {
        var 
    friendlyname =  $('friendlyname').value;
        $(
    'auth_details_computer_name').style.color='#85847f';
        if ( 
    friendlyname == defaultFriendlyNameText )
        {
            
    friendlyname '';
        }
        $(
    'auth_buttonsets').childElements().invoke('hide');
        if ( $(
    'auth_buttonset_waiting') )
            $(
    'auth_buttonset_waiting').show();

                
    document.forms['logon'].elements['loginfriendlyname'].value friendlyname;
            
    document.forms['logon'].elements['emailauth'].value = $('authcode').value;
            
    DoLogin();
    }

    function 
    SetEmailAuthModalStatestep )
    {

            $(
    'auth_messages').childElements().invoke('hide');
            $(
    'auth_message_' step ).show();

            $(
    'auth_details_messages').childElements().invoke('hide');
            if ( $(
    'auth_details_' step ) )
                $(
    'auth_details_' step ).show();

            $(
    'auth_buttonsets').childElements().invoke('hide');
            if ( $(
    'auth_buttonset_' step ) )
                $(
    'auth_buttonset_' step ).show();

            $(
    'authcode_help_supportlink').hide();

            var 
    icon='key';
            var 
    bShowAuthcodeEntry true;
            if ( 
    step == 'entercode' )
            {
                
    icon 'key';
            }
            else if ( 
    step == 'checkspam' )
            {
                
    icon 'trash';
            }
            else if ( 
    step == 'success' )
            {
                
    icon 'unlock';
                
    bShowAuthcodeEntry false;
                $(
    'success_continue_btn').focus();
            }
            else if ( 
    step == 'incorrectcode' )
            {
                
    icon 'lock';
            }
            else if ( 
    step == 'help' )
            {
                
    icon 'steam';
                
    bShowAuthcodeEntry false;
                $(
    'authcode_help_supportlink').show();
            }

            if ( 
    bShowAuthcodeEntry )
            {
                $(
    'authcode_entry').show();
                $(
    'auth_details_computer_name').show();
            }
            else
            {
                $(
    'authcode_entry').hide();
                $(
    'auth_details_computer_name').hide();
            }

            $(
    'auth_icon').className 'auth_icon auth_icon_' icon;

        }

    function 
    OnAuthcodeFocusdefaultText )
    {
        if ( $(
    'authcode').value == defaultText )
        {
            $(
    'authcode').value '';
            $(
    'authcode').removeClassName'defaulttext' );
        }
    }

    function 
    OnAuthcodeBlurdefaultText )
    {
        if ( $(
    'authcode').value == '' )
        {
            $(
    'authcode').value defaultText;
            $(
    'authcode').addClassName'defaulttext' );
        }
    }

    function 
    OnFriendlyNameFocusdefaultText 

        if ( $(
    'friendlyname').value == defaultText 
        { 
            $(
    'friendlyname').value ''
            $(
    'friendlyname').removeClassName'defaulttext' ); 
        } 

      
    function 
    OnFriendlyNameBlurdefaultText 

        if ( $(
    'friendlyname').value == '' 
        { 
            $(
    'friendlyname').value defaultText
            $(
    'friendlyname').addClassName'defaulttext' ); 
        } 



    function 
    StartTwoFactorAuthProcess()
    {
        
    g_bInTwoFactorAuthProcess true;
        
    SetTwoFactorAuthModalState'entercode' );

                $(
    'loginTwoFactorCodeModal').OnModalDismissal CancelTwoFactorAuthProcess;
        }


    function 
    CancelTwoFactorAuthProcess()
    {
        
    g_bInTwoFactorAuthProcess false;

        if ( 
    g_bEmailAuthSuccessful )
            
    LoginComplete();
        else
            
    ClearLoginForm();
    }


    function 
    OnTwoFactorAuthSuccessContinue()
    {
        if ( 
    g_bLoginTransferInProgress )
        {
                        $(
    'login_twofactorauth_buttonsets').childElements().invoke('hide');
                if ( $(
    'login_twofactorauth_buttonset_waiting') )
                    $(
    'login_twofactorauth_buttonset_waiting').show();

            
    g_bTwoFactorAuthSuccessfulWantToLeave true;
        }
        else
            
    LoginComplete();
    }

    function 
    SetTwoFactorAuthModalStatestep )
    {

        if ( 
    step == 'success' )
        {
            
    g_bInTwoFactorAuthProcess false;
        }

        $(
    'login_twofactorauth_messages').childElements().invoke('hide');
        if ( $(
    'login_twofactorauth_message_' step ) )
            $(
    'login_twofactorauth_message_' step ).show();

        $(
    'login_twofactorauth_details_messages').childElements().invoke('hide');
        if ( $(
    'login_twofactorauth_details_' step ) )
            $(
    'login_twofactorauth_details_' step ).show();

        $(
    'login_twofactorauth_buttonsets').childElements().invoke('hide');
        if ( $(
    'login_twofactorauth_buttonset_' step ) )
            $(
    'login_twofactorauth_buttonset_' step ).show();

        $(
    'login_twofactor_authcode_help_supportlink').hide();

        var 
    icon 'key';
        if ( 
    step == 'entercode' )
        {
            
    showModal'loginTwoFactorCodeModal'true );
            $(
    'twofactorcode_entry').focus();
        }
        else if ( 
    step == 'incorrectcode' )
        {
            
    icon 'lock';
            $(
    'twofactorcode_entry').focus();
        }
        else if ( 
    step == 'help' )
        {
            
    icon 'steam';
            $(
    'login_twofactor_authcode_entry').hide();
            $(
    'login_twofactor_authcode_help_supportlink').show();
        }

        if ( ! 
    g_bInTwoFactorAuthProcess )
        {
            $(
    'loginTwoFactorCodeModal').hide();
        }

        $(
    'login_twofactorauth_icon').className 'auth_icon auth_icon_' icon;

        }

    function 
    SubmitTwoFactorCode( )
    {
        
    g_sAuthCode = $('twofactorcode_entry').value;


        $(
    'login_twofactorauth_messages').childElements().invoke('hide');
        $(
    'login_twofactorauth_details_messages').childElements().invoke('hide');

        $(
    'login_twofactorauth_buttonsets').childElements().invoke('hide');
        if ( $(
    'login_twofactorauth_buttonset_waiting') )
        {
            $(
    'login_twofactorauth_buttonset_waiting').show();
        }

        
    DoLogin();
    }

    function 
    OnTwoFactorCodeFocusdefaultText )
    {
        if ( $(
    'twofactorcode_entry').value == defaultText )
        {
            $(
    'twofactorcode_entry').value '';
            $(
    'twofactorcode_entry').removeClassName'defaulttext' );
        }
    }

    function 
    OnTwoFactorCodeBlurdefaultText )
    {

    Die Datei /getrsakey sieht in etwa so aus:
    Code:
    {"success":true,"publickey_mod":"BC7077AD156C53287C743726B52C0B9D3E52E1AFC34983A19CACF2610F08E9356BA792E491517D743B67E3A17F1E7968CF0738B2DB721E44C29E15813115C7760DF3EED3C1AF9F2613A4362D92D929D7074229C94497A5DD5D99990FE06A3802596091DB169F03F9810D2B2D5CFB520B56793F4156E50F577B749AB8C938198F0F3C587BD689B7991EFDC36BA354450B3131341C095B57945DFC5BA0EDA42BA0AE0CD35C0BC7708D6C02F7FAC06A4FD8FF14DAEE1DCEA82E27C70810AF7BB5CAB1CAA6C5BBF1F50FA9ECF0E473FFC98C997A41E80EFDB69C0963031688AD5FE9F22DF0F066AC308B3ADAAF69115CE55391216E227DDCB7C75572C1B0752AA8A9","publickey_exp":"010001","timestamp":"288170250000","token_gid":""}
    Das ist die RSA Klasse
    PHP-Code:
    var RSAPublicKey = function($modulus_hex$encryptionExponent_hex) {
        
    this.modulus = new BigInteger$modulus_hex16);
        
    this.encryptionExponent = new BigInteger$encryptionExponent_hex16);
    }

    var 
    Base64 = {
        
    base64"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
        
    encode: function($input) {
            if (!
    $input) {
                return 
    false;
            }
            var 
    $output "";
            var 
    $chr1$chr2$chr3;
            var 
    $enc1$enc2$enc3$enc4;
            var 
    $i 0;
            do {
                
    $chr1 $input.charCodeAt($i++);
                
    $chr2 $input.charCodeAt($i++);
                
    $chr3 $input.charCodeAt($i++);
                
    $enc1 $chr1 >> 2;
                
    $enc2 = (($chr1 3) << 4) | ($chr2 >> 4);
                
    $enc3 = (($chr2 15) << 2) | ($chr3 >> 6);
                
    $enc4 $chr3 63;
                if (
    isNaN($chr2)) $enc3 $enc4 64;
                else if (
    isNaN($chr3)) $enc4 64;
                
    $output += this.base64.charAt($enc1) + this.base64.charAt($enc2) + this.base64.charAt($enc3) + this.base64.charAt($enc4);
            } while (
    $i $input.length);
            return 
    $output;
        },
        
    decode: function($input) {
            if(!
    $input) return false;
            
    $input $input.replace(/[^A-Za-z0-9\+\/\=]/g"");
            var 
    $output "";
            var 
    $enc1$enc2$enc3$enc4;
            var 
    $i 0;
            do {
                
    $enc1 this.base64.indexOf($input.charAt($i++));
                
    $enc2 this.base64.indexOf($input.charAt($i++));
                
    $enc3 this.base64.indexOf($input.charAt($i++));
                
    $enc4 this.base64.indexOf($input.charAt($i++));
                
    $output += String.fromCharCode(($enc1 << 2) | ($enc2 >> 4));
                if (
    $enc3 != 64$output += String.fromCharCode((($enc2 15) << 4) | ($enc3 >> 2));
                if (
    $enc4 != 64$output += String.fromCharCode((($enc3 3) << 6) | $enc4);
            } while (
    $i $input.length);
            return 
    $output
        }
    };

    var 
    Hex = {
        
    hex"0123456789abcdef",
        
    encode: function($input) {
            if(!
    $input) return false;
            var 
    $output "";
            var 
    $k;
            var 
    $i 0;
            do {
                
    $k $input.charCodeAt($i++);
                
    $output += this.hex.charAt(($k >> 4) &0xf) + this.hex.charAt($k 0xf);
            } while (
    $i $input.length);
            return 
    $output;
        },
        
    decode: function($input) {
            if(!
    $input) return false;
            
    $input $input.replace(/[^0-9abcdef]/g"");
            var 
    $output "";
            var 
    $i 0;
            do {
                
    $output += String.fromCharCode(((this.hex.indexOf($input.charAt($i++)) << 4) & 0xf0) | (this.hex.indexOf($input.charAt($i++)) & 0xf));
            } while (
    $i $input.length);
            return 
    $output;
        }
    };

    var 
    RSA = {

        
    getPublicKey: function( $modulus_hex$exponent_hex ) {
            return new 
    RSAPublicKey$modulus_hex$exponent_hex );
        },

        
    encrypt: function($data$pubkey) {
            if (!
    $pubkey) return false;
            
    $data this.pkcs1pad2($data,($pubkey.modulus.bitLength()+7)>>3);
            if(!
    $data) return false;
            
    $data $data.modPowInt($pubkey.encryptionExponent$pubkey.modulus);
            if(!
    $data) return false;
            
    $data $data.toString(16);
            if((
    $data.length 1) == 1)
                
    $data "0" $data;
            return 
    Base64.encode(Hex.decode($data));
        },

        
    pkcs1pad2: function($data$keysize) {
            if(
    $keysize $data.length 11)
                return 
    null;
            var 
    $buffer = [];
            var 
    $i $data.length 1;
            while(
    $i >= && $keysize 0)
                
    $buffer[--$keysize] = $data.charCodeAt($i--);
            
    $buffer[--$keysize] = 0;
            while(
    $keysize 2)
                
    $buffer[--$keysize] = Math.floor(Math.random()*254) + 1;
            
    $buffer[--$keysize] = 2;
            
    $buffer[--$keysize] = 0;
            return new 
    BigInteger($buffer);
        }

    Die RSA Klasse verwendet zum Teil die Klasse BigInteger:
    PHP-Code:

    // Copyright (c) 2005  Tom Wu
    // All Rights Reserved.
    // See "LICENSE" for details.

    /*
     * Copyright (c) 2003-2005  Tom Wu
     * All Rights Reserved.
     *
     * Permission is hereby granted, free of charge, to any person obtaining
     * a copy of this software and associated documentation files (the
     * "Software"), to deal in the Software without restriction, including
     * without limitation the rights to use, copy, modify, merge, publish,
     * distribute, sublicense, and/or sell copies of the Software, and to
     * permit persons to whom the Software is furnished to do so, subject to
     * the following conditions:
     *
     * The above copyright notice and this permission notice shall be
     * included in all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
     * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
     * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
     *
     * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
     * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
     * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
     * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
     * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     *
     * In addition, the following condition applies:
     *
     * All redistributions must retain an intact copy of this copyright notice
     * and disclaimer.
     */

    // Basic JavaScript BN library - subset useful for RSA encryption.

    // Bits per digit
    var dbits;

    // JavaScript engine analysis
    var canary 0xdeadbeefcafe;
    var 
    j_lm = ((canary&0xffffff)==0xefcafe);

    // (public) Constructor
    function BigInteger(a,b,c) {
      if(
    != null)
        if(
    "number" == typeof athis.fromNumber(a,b,c);
        else if(
    == null && "string" != typeof athis.fromString(a,256);
        else 
    this.fromString(a,b);
    }

    // return new, unset BigInteger
    function nbi() { return new BigInteger(null); }

    // am: Compute w_j += (x*this_i), propagate carries,
    // c is initial carry, returns final carry.
    // c < 3*dvalue, x < 2*dvalue, this_i < dvalue
    // We need to select the fastest one that works in this environment.

    // am1: use a single mult and divide to get the high bits,
    // max digit bits should be 26 because
    // max internal value = 2*dvalue^2-2*dvalue (< 2^53)
    function am1(i,x,w,j,c,n) {
      while(--
    >= 0) {
        var 
    x*this[i++]+w[j]+c;
        
    Math.floor(v/0x4000000);
        
    w[j++] = v&0x3ffffff;
      }
      return 
    c;
    }
    // am2 avoids a big mult-and-extract completely.
    // Max digit bits should be <= 30 because we do bitwise ops
    // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
    function am2(i,x,w,j,c,n) {
      var 
    xl x&0x7fffxh x>>15;
      while(--
    >= 0) {
        var 
    this[i]&0x7fff;
        var 
    this[i++]>>15;
        var 
    xh*l+h*xl;
        
    xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
        
    = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
        
    w[j++] = l&0x3fffffff;
      }
      return 
    c;
    }
    // Alternately, set max digit bits to 28 since some
    // browsers slow down when dealing with 32-bit numbers.
    function am3(i,x,w,j,c,n) {
      var 
    xl x&0x3fffxh x>>14;
      while(--
    >= 0) {
        var 
    this[i]&0x3fff;
        var 
    this[i++]>>14;
        var 
    xh*l+h*xl;
        
    xl*l+((m&0x3fff)<<14)+w[j]+c;
        
    = (l>>28)+(m>>14)+xh*h;
        
    w[j++] = l&0xfffffff;
      }
      return 
    c;
    }
    if(
    j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
      
    BigInteger.prototype.am am2;
      
    dbits 30;
    }
    else if(
    j_lm && (navigator.appName != "Netscape")) {
      
    BigInteger.prototype.am am1;
      
    dbits 26;
    }
    else { 
    // Mozilla/Netscape seems to prefer am3
      
    BigInteger.prototype.am am3;
      
    dbits 28;
    }

    BigInteger.prototype.DB dbits;
    BigInteger.prototype.DM = ((1<<dbits)-1);
    BigInteger.prototype.DV = (1<<dbits);

    var 
    BI_FP 52;
    BigInteger.prototype.FV Math.pow(2,BI_FP);
    BigInteger.prototype.F1 BI_FP-dbits;
    BigInteger.prototype.F2 2*dbits-BI_FP;

    // Digit conversions
    var BI_RM "0123456789abcdefghijklmnopqrstuvwxyz";
    var 
    BI_RC = new Array();
    var 
    rr,vv;
    rr "0".charCodeAt(0);
    for(
    vv 0vv <= 9; ++vvBI_RC[rr++] = vv;
    rr "a".charCodeAt(0);
    for(
    vv 10vv 36; ++vvBI_RC[rr++] = vv;
    rr "A".charCodeAt(0);
    for(
    vv 10vv 36; ++vvBI_RC[rr++] = vv;

    function 
    int2char(n) { return BI_RM.charAt(n); }
    function 
    intAt(s,i) {
      var 
    BI_RC[s.charCodeAt(i)];
      return (
    c==null)?-1:c;
    }

    // (protected) copy this to r
    function bnpCopyTo(r) {
      for(var 
    this.t-1>= 0; --ir[i] = this[i];
      
    r.this.t;
      
    r.this.s;
    }

    // (protected) set from integer value x, -DV <= x < DV
    function bnpFromInt(x) {
      
    this.1;
      
    this.= (x<0)?-1:0;
      if(
    0this[0] = x;
      else if(
    < -1this[0] = x+DV;
      else 
    this.0;
    }

    // return bigint initialized to value
    function nbv(i) { var nbi(); r.fromInt(i); return r; }

    // (protected) set from string and radix
    function bnpFromString(s,b) {
      var 
    k;
      if(
    == 164;
      else if(
    == 83;
      else if(
    == 2568// byte array
      
    else if(== 21;
      else if(
    == 325;
      else if(
    == 42;
      else { 
    this.fromRadix(s,b); return; }
      
    this.0;
      
    this.0;
      var 
    s.lengthmi falsesh 0;
      while(--
    >= 0) {
        var 
    = (k==8)?s[i]&0xff:intAt(s,i);
        if(
    0) {
          if(
    s.charAt(i) == "-"mi true;
          continue;
        }
        
    mi false;
        if(
    sh == 0)
          
    this[this.t++] = x;
        else if(
    sh+this.DB) {
          
    this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;
          
    this[this.t++] = (x>>(this.DB-sh));
        }
        else
          
    this[this.t-1] |= x<<sh;
        
    sh += k;
        if(
    sh >= this.DBsh -= this.DB;
      }
      if(
    == && (s[0]&0x80) != 0) {
        
    this.= -1;
        if(
    sh 0this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;
      }
      
    this.clamp();
      if(
    miBigInteger.ZERO.subTo(this,this);
    }

    // (protected) clamp off excess high words
    function bnpClamp() {
      var 
    this.s&this.DM;
      while(
    this.&& this[this.t-1] == c) --this.t;
    }

    // (public) return string representation in given radix
    function bnToString(b) {
      if(
    this.0) return "-"+this.negate().toString(b);
      var 
    k;
      if(
    == 164;
      else if(
    == 83;
      else if(
    == 21;
      else if(
    == 325;
      else if(
    == 42;
      else return 
    this.toRadix(b);
      var 
    km = (1<<k)-1dfalse""this.t;
      var 
    this.DB-(i*this.DB)%k;
      if(
    i-- > 0) {
        if(
    this.DB && (this[i]>>p) > 0) { trueint2char(d); }
        while(
    >= 0) {
          if(
    k) {
            
    = (this[i]&((1<<p)-1))<<(k-p);
            
    |= this[--i]>>(p+=this.DB-k);
          }
          else {
            
    = (this[i]>>(p-=k))&km;
            if(
    <= 0) { += this.DB; --i; }
          }
          if(
    0true;
          if(
    m+= int2char(d);
        }
      }
      return 
    m?r:"0";
    }

    // (public) -this
    function bnNegate() { var nbi(); BigInteger.ZERO.subTo(this,r); return r; }

    // (public) |this|
    function bnAbs() { return (this.s<0)?this.negate():this; }

    // (public) return + if this > a, - if this < a, 0 if equal
    function bnCompareTo(a) {
      var 
    this.s-a.s;
      if(
    != 0) return r;
      var 
    this.t;
      
    i-a.t;
      if(
    != 0) return r;
      while(--
    >= 0) if((r=this[i]-a[i]) != 0) return r;
      return 
    0;
    }

    // returns bit length of the integer x
    function nbits(x) {
      var 
    1t;
      if((
    t=x>>>16) != 0) { t+= 16; }
      if((
    t=x>>8) != 0) { t+= 8; }
      if((
    t=x>>4) != 0) { t+= 4; }
      if((
    t=x>>2) != 0) { t+= 2; }
      if((
    t=x>>1) != 0) { t+= 1; }
      return 
    r;
    }

    // (public) return the number of bits in "this"
    function bnBitLength() {
      if(
    this.<= 0) return 0;
      return 
    this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
    }

    // (protected) r = this << n*DB
    function bnpDLShiftTo(n,r) {
      var 
    i;
      for(
    this.t-1>= 0; --ir[i+n] = this[i];
      for(
    n-1>= 0; --ir[i] = 0;
      
    r.this.t+n;
      
    r.this.s;
    }

    // (protected) r = this >> n*DB
    function bnpDRShiftTo(n,r) {
      for(var 
    nthis.t; ++ir[i-n] = this[i];
      
    r.Math.max(this.t-n,0);
      
    r.this.s;
    }

    // (protected) r = this << n
    function bnpLShiftTo(n,r) {
      var 
    bs n%this.DB;
      var 
    cbs this.DB-bs;
      var 
    bm = (1<<cbs)-1;
      var 
    ds Math.floor(n/this.DB), = (this.s<<bs)&this.DMi;
      for(
    this.t-1>= 0; --i) {
        
    r[i+ds+1] = (this[i]>>cbs)|c;
        
    = (this[i]&bm)<<bs;
      }
      for(
    ds-1>= 0; --ir[i] = 0;
      
    r[ds] = c;
      
    r.this.t+ds+1;
      
    r.this.s;
      
    r.clamp();
    }

    // (protected) r = this >> n
    function bnpRShiftTo(n,r) {
      
    r.this.s;
      var 
    ds Math.floor(n/this.DB);
      if(
    ds >= this.t) { r.0; return; }
      var 
    bs n%this.DB;
      var 
    cbs this.DB-bs;
      var 
    bm = (1<<bs)-1;
      
    r[0] = this[ds]>>bs;
      for(var 
    ds+1this.t; ++i) {
        
    r[i-ds-1] |= (this[i]&bm)<<cbs;
        
    r[i-ds] = this[i]>>bs;
      }
      if(
    bs 0r[this.t-ds-1] |= (this.s&bm)<<cbs;
      
    r.this.t-ds;
      
    r.clamp();
    }

    // (protected) r = this - a
    function bnpSubTo(a,r) {
      var 
    00Math.min(a.t,this.t);
      while(
    m) {
        
    += this[i]-a[i];
        
    r[i++] = c&this.DM;
        
    >>= this.DB;
      }
      if(
    a.this.t) {
        
    -= a.s;
        while(
    this.t) {
          
    += this[i];
          
    r[i++] = c&this.DM;
          
    >>= this.DB;
        }
        
    += this.s;
      }
      else {
        
    += this.s;
        while(
    a.t) {
          
    -= a[i];
          
    r[i++] = c&this.DM;
          
    >>= this.DB;
        }
        
    -= a.s;
      }
      
    r.= (c<0)?-1:0;
      if(
    < -1r[i++] = this.DV+c;
      else if(
    0r[i++] = c;
      
    r.i;
      
    r.clamp();
    }

    // (protected) r = this * a, r != this,a (HAC 14.12)
    // "this" should be the larger one if appropriate.
    function bnpMultiplyTo(a,r) {
      var 
    this.abs(), a.abs();
      var 
    x.t;
      
    r.i+y.t;
      while(--
    >= 0r[i] = 0;
      for(
    0y.t; ++ir[i+x.t] = x.am(0,y[i],r,i,0,x.t);
      
    r.0;
      
    r.clamp();
      if(
    this.!= a.sBigInteger.ZERO.subTo(r,r);
    }

    // (protected) r = this^2, r != this (HAC 14.16)
    function bnpSquareTo(r) {
      var 
    this.abs();
      var 
    r.2*x.t;
      while(--
    >= 0r[i] = 0;
      for(
    0x.t-1; ++i) {
        var 
    x.am(i,x[i],r,2*i,0,1);
        if((
    r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
          
    r[i+x.t] -= x.DV;
          
    r[i+x.t+1] = 1;
        }
      }
      if(
    r.0r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
      
    r.0;
      
    r.clamp();
    }

    // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
    // r != q, this != m.  q or r may be null.
    function bnpDivRemTo(m,q,r) {
      var 
    pm m.abs();
      if(
    pm.<= 0) return;
      var 
    pt this.abs();
      if(
    pt.pm.t) {
        if(
    != nullq.fromInt(0);
        if(
    != nullthis.copyTo(r);
        return;
      }
      if(
    == nullnbi();
      var 
    nbi(), ts this.sms m.s;
      var 
    nsh this.DB-nbits(pm[pm.t-1]);    // normalize modulus
      
    if(nsh 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
      else { 
    pm.copyTo(y); pt.copyTo(r); }
      var 
    ys y.t;
      var 
    y0 y[ys-1];
      if(
    y0 == 0) return;
      var 
    yt y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);
      var 
    d1 this.FV/ytd2 = (1<<this.F1)/yt1<<this.F2;
      var 
    r.ti-ys= (q==null)?nbi():q;
      
    y.dlShiftTo(j,t);
      if(
    r.compareTo(t) >= 0) {
        
    r[r.t++] = 1;
        
    r.subTo(t,r);
      }
      
    BigInteger.ONE.dlShiftTo(ys,t);
      
    t.subTo(y,y);    // "negative" y so we can replace sub with am later
      
    while(y.ysy[y.t++] = 0;
      while(--
    >= 0) {
        
    // Estimate quotient digit
        
    var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
        if((
    r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {    // Try it out
          
    y.dlShiftTo(j,t);
          
    r.subTo(t,r);
          while(
    r[i] < --qdr.subTo(t,r);
        }
      }
      if(
    != null) {
        
    r.drShiftTo(ys,q);
        if(
    ts != msBigInteger.ZERO.subTo(q,q);
      }
      
    r.ys;
      
    r.clamp();
      if(
    nsh 0r.rShiftTo(nsh,r);    // Denormalize remainder
      
    if(ts 0BigInteger.ZERO.subTo(r,r);
    }

    // (public) this mod a
    function bnMod(a) {
      var 
    nbi();
      
    this.abs().divRemTo(a,null,r);
      if(
    this.&& r.compareTo(BigInteger.ZERO) > 0a.subTo(r,r);
      return 
    r;
    }

    // Modular reduction using "classic" algorithm
    function Classic(m) { this.m; }
    function 
    cConvert(x) {
      if(
    x.|| x.compareTo(this.m) >= 0) return x.mod(this.m);
      else return 
    x;
    }
    function 
    cRevert(x) { return x; }
    function 
    cReduce(x) { x.divRemTo(this.m,null,x); }
    function 
    cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
    function 
    cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }

    Classic.prototype.convert cConvert;
    Classic.prototype.revert cRevert;
    Classic.prototype.reduce cReduce;
    Classic.prototype.mulTo cMulTo;
    Classic.prototype.sqrTo cSqrTo;

    // (protected) return "-1/this % 2^DB"; useful for Mont. reduction
    // justification:
    //         xy == 1 (mod m)
    //         xy =  1+km
    //   xy(2-xy) = (1+km)(1-km)
    // x[y(2-xy)] = 1-k^2m^2
    // x[y(2-xy)] == 1 (mod m^2)
    // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
    // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
    // JS multiply "overflows" differently from C/C++, so care is needed here.
    function bnpInvDigit() {
      if(
    this.1) return 0;
      var 
    this[0];
      if((
    x&1) == 0) return 0;
      var 
    x&3;        // y == 1/x mod 2^2
      
    = (y*(2-(x&0xf)*y))&0xf;    // y == 1/x mod 2^4
      
    = (y*(2-(x&0xff)*y))&0xff;    // y == 1/x mod 2^8
      
    = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff;    // y == 1/x mod 2^16
      // last step - calculate inverse mod DV directly;
      // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
      
    = (y*(2-x*y%this.DV))%this.DV;        // y == 1/x mod 2^dbits
      // we really want the negative inverse, and -DV < y < DV
      
    return (y>0)?this.DV-y:-y;
    }

    // Montgomery reduction
    function Montgomery(m) {
      
    this.m;
      
    this.mp m.invDigit();
      
    this.mpl this.mp&0x7fff;
      
    this.mph this.mp>>15;
      
    this.um = (1<<(m.DB-15))-1;
      
    this.mt2 2*m.t;
    }

    // xR mod m
    function montConvert(x) {
      var 
    nbi();
      
    x.abs().dlShiftTo(this.m.t,r);
      
    r.divRemTo(this.m,null,r);
      if(
    x.&& r.compareTo(BigInteger.ZERO) > 0this.m.subTo(r,r);
      return 
    r;
    }

    // x/R mod m
    function montRevert(x) {
      var 
    nbi();
      
    x.copyTo(r);
      
    this.reduce(r);
      return 
    r;
    }

    // x = x/R mod m (HAC 14.32)
    function montReduce(x) {
      while(
    x.<= this.mt2)    // pad x so am has enough room later
        
    x[x.t++] = 0;
      for(var 
    0this.m.t; ++i) {
        
    // faster way of calculating u0 = x[i]*mp mod DV
        
    var x[i]&0x7fff;
        var 
    u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
        
    // use am to combine the multiply-shift-add into one call
        
    i+this.m.t;
        
    x[j] += this.m.am(0,u0,x,i,0,this.m.t);
        
    // propagate carry
        
    while(x[j] >= x.DV) { x[j] -= x.DVx[++j]++; }
      }
      
    x.clamp();
      
    x.drShiftTo(this.m.t,x);
      if(
    x.compareTo(this.m) >= 0x.subTo(this.m,x);
    }

    // r = "x^2/R mod m"; x != r
    function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }

    // r = "xy/R mod m"; x,y != r
    function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }

    Montgomery.prototype.convert montConvert;
    Montgomery.prototype.revert montRevert;
    Montgomery.prototype.reduce montReduce;
    Montgomery.prototype.mulTo montMulTo;
    Montgomery.prototype.sqrTo montSqrTo;

    // (protected) true iff this is even
    function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }

    // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
    function bnpExp(e,z) {
      if(
    0xffffffff || 1) return BigInteger.ONE;
      var 
    nbi(), r2 nbi(), z.convert(this), nbits(e)-1;
      
    g.copyTo(r);
      while(--
    >= 0) {
        
    z.sqrTo(r,r2);
        if((
    e&(1<<i)) > 0z.mulTo(r2,g,r);
        else { var 
    rr2r2 t; }
      }
      return 
    z.revert(r);
    }

    // (public) this^e % m, 0 <= e < 2^32
    function bnModPowInt(e,m) {
      var 
    z;
      if(
    256 || m.isEven()) = new Classic(m); else = new Montgomery(m);
      return 
    this.exp(e,z);
    }

    // protected
    BigInteger.prototype.copyTo bnpCopyTo;
    BigInteger.prototype.fromInt bnpFromInt;
    BigInteger.prototype.fromString bnpFromString;
    BigInteger.prototype.clamp bnpClamp;
    BigInteger.prototype.dlShiftTo bnpDLShiftTo;
    BigInteger.prototype.drShiftTo bnpDRShiftTo;
    BigInteger.prototype.lShiftTo bnpLShiftTo;
    BigInteger.prototype.rShiftTo bnpRShiftTo;
    BigInteger.prototype.subTo bnpSubTo;
    BigInteger.prototype.multiplyTo bnpMultiplyTo;
    BigInteger.prototype.squareTo bnpSquareTo;
    BigInteger.prototype.divRemTo bnpDivRemTo;
    BigInteger.prototype.invDigit bnpInvDigit;
    BigInteger.prototype.isEven bnpIsEven;
    BigInteger.prototype.exp bnpExp;

    // public
    BigInteger.prototype.toString bnToString;
    BigInteger.prototype.negate bnNegate;
    BigInteger.prototype.abs bnAbs;
    BigInteger.prototype.compareTo bnCompareTo;
    BigInteger.prototype.bitLength bnBitLength;
    BigInteger.prototype.mod bnMod;
    BigInteger.prototype.modPowInt bnModPowInt;

    // "constants"
    BigInteger.ZERO nbv(0);
    BigInteger.ONE nbv(1);


    // Copyright (c) 2005  Tom Wu
    // All Rights Reserved.
    // See "LICENSE" for details.

    // Extended JavaScript BN functions, required for RSA private ops.

    // (public)
    function bnClone() { var nbi(); this.copyTo(r); return r; }

    // (public) return value as integer
    function bnIntValue() {
      if(
    this.0) {
        if(
    this.== 1) return this[0]-this.DV;
        else if(
    this.== 0) return -1;
      }
      else if(
    this.== 1) return this[0];
      else if(
    this.== 0) return 0;
      
    // assumes 16 < DB < 32
      
    return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];
    }

    // (public) return value as byte
    function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }

    // (public) return value as short (assumes DB>=16)
    function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }

    // (protected) return x s.t. r^x < DV
    function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }

    // (public) 0 if this == 0, 1 if this > 0
    function bnSigNum() {
      if(
    this.0) return -1;
      else if(
    this.<= || (this.== && this[0] <= 0)) return 0;
      else return 
    1;
    }

    // (protected) convert to radix string
    function bnpToRadix(b) {
      if(
    == null10;
      if(
    this.signum() == || || 36) return "0";
      var 
    cs this.chunkSize(b);
      var 
    Math.pow(b,cs);
      var 
    nbv(a), nbi(), nbi(), "";
      
    this.divRemTo(d,y,z);
      while(
    y.signum() > 0) {
        
    = (a+z.intValue()).toString(b).substr(1) + r;
        
    y.divRemTo(d,y,z);
      }
      return 
    z.intValue().toString(b) + r;
    }

    // (protected) convert from radix string
    function bnpFromRadix(s,b) {
      
    this.fromInt(0);
      if(
    == null10;
      var 
    cs this.chunkSize(b);
      var 
    Math.pow(b,cs), mi false00;
      for(var 
    0s.length; ++i) {
        var 
    intAt(s,i);
        if(
    0) {
          if(
    s.charAt(i) == "-" && this.signum() == 0mi true;
          continue;
        }
        
    b*w+x;
        if(++
    >= cs) {
          
    this.dMultiply(d);
          
    this.dAddOffset(w,0);
          
    0;
          
    0;
        }
      }
      if(
    0) {
        
    this.dMultiply(Math.pow(b,j));
        
    this.dAddOffset(w,0);
      }
      if(
    miBigInteger.ZERO.subTo(this,this);
    }

    // (protected) alternate constructor
    function bnpFromNumber(a,b,c) {
      if(
    "number" == typeof b) {
        
    // new BigInteger(int,int,RNG)
        
    if(2this.fromInt(1);
        else {
          
    this.fromNumber(a,c);
          if(!
    this.testBit(a-1))    // force MSB set
            
    this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
          if(
    this.isEven()) this.dAddOffset(1,0); // force odd
          
    while(!this.isProbablePrime(b)) {
            
    this.dAddOffset(2,0);
            if(
    this.bitLength() > athis.subTo(BigInteger.ONE.shiftLeft(a-1),this);
          }
        }
      }
      else {
        
    // new BigInteger(int,RNG)
        
    var = new Array(), a&7;
        
    x.length = (a>>3)+1;
        
    b.nextBytes(x);
        if(
    0x[0] &= ((1<<t)-1); else x[0] = 0;
        
    this.fromString(x,256);
      }
    }

    // (public) convert to bigendian byte array
    function bnToByteArray() {
      var 
    this.t= new Array();
      
    r[0] = this.s;
      var 
    this.DB-(i*this.DB)%8d0;
      if(
    i-- > 0) {
        if(
    this.DB && (this[i]>>p) != (this.s&this.DM)>>p)
          
    r[k++] = d|(this.s<<(this.DB-p));
        while(
    >= 0) {
          if(
    8) {
            
    = (this[i]&((1<<p)-1))<<(8-p);
            
    |= this[--i]>>(p+=this.DB-8);
          }
          else {
            
    = (this[i]>>(p-=8))&0xff;
            if(
    <= 0) { += this.DB; --i; }
          }
          if((
    d&0x80) != 0|= -256;
          if(
    == && (this.s&0x80) != (d&0x80)) ++k;
          if(
    || != this.sr[k++] = d;
        }
      }
      return 
    r;
    }

    function 
    bnEquals(a) { return(this.compareTo(a)==0); }
    function 
    bnMin(a) { return(this.compareTo(a)<0)?this:a; }
    function 
    bnMax(a) { return(this.compareTo(a)>0)?this:a; }

    // (protected) r = this op a (bitwise)
    function bnpBitwiseTo(a,op,r) {
      var 
    ifMath.min(a.t,this.t);
      for(
    0m; ++ir[i] = op(this[i],a[i]);
      if(
    a.this.t) {
        
    a.s&this.DM;
        for(
    mthis.t; ++ir[i] = op(this[i],f);
        
    r.this.t;
      }
      else {
        
    this.s&this.DM;
        for(
    ma.t; ++ir[i] = op(f,a[i]);
        
    r.a.t;
      }
      
    r.op(this.s,a.s);
      
    r.clamp();
    }

    // (public) this & a
    function op_and(x,y) { return x&y; }
    function 
    bnAnd(a) { var nbi(); this.bitwiseTo(a,op_and,r); return r; }

    // (public) this | a
    function op_or(x,y) { return x|y; }
    function 
    bnOr(a) { var nbi(); this.bitwiseTo(a,op_or,r); return r; }

    // (public) this ^ a
    function op_xor(x,y) { return x^y; }
    function 
    bnXor(a) { var nbi(); this.bitwiseTo(a,op_xor,r); return r; }

    // (public) this & ~a
    function op_andnot(x,y) { return x&~y; }
    function 
    bnAndNot(a) { var nbi(); this.bitwiseTo(a,op_andnot,r); return r; }

    // (public) ~this
    function bnNot() {
      var 
    nbi();
      for(var 
    0this.t; ++ir[i] = this.DM&~this[i];
      
    r.this.t;
      
    r.= ~this.s;
      return 
    r;
    }

    // (public) this << n
    function bnShiftLeft(n) {
      var 
    nbi();
      if(
    0this.rShiftTo(-n,r); else this.lShiftTo(n,r);
      return 
    r;
    }

    // (public) this >> n
    function bnShiftRight(n) {
      var 
    nbi();
      if(
    0this.lShiftTo(-n,r); else this.rShiftTo(n,r);
      return 
    r;
    }

    // return index of lowest 1-bit in x, x < 2^31
    function lbit(x) {
      if(
    == 0) return -1;
      var 
    0;
      if((
    x&0xffff) == 0) { >>= 16+= 16; }
      if((
    x&0xff) == 0) { >>= 8+= 8; }
      if((
    x&0xf) == 0) { >>= 4+= 4; }
      if((
    x&3) == 0) { >>= 2+= 2; }
      if((
    x&1) == 0) ++r;
      return 
    r;
    }

    // (public) returns index of lowest 1-bit (or -1 if none)
    function bnGetLowestSetBit() {
      for(var 
    0this.t; ++i)
        if(
    this[i] != 0) return i*this.DB+lbit(this[i]);
      if(
    this.0) return this.t*this.DB;
      return -
    1;
    }

    // return number of 1 bits in x
    function cbit(x) {
      var 
    0;
      while(
    != 0) { &= x-1; ++r; }
      return 
    r;
    }

    // (public) return number of set bits
    function bnBitCount() {
      var 
    0this.s&this.DM;
      for(var 
    0this.t; ++i+= cbit(this[i]^x);
      return 
    r;
    }

    // (public) true iff nth bit is set
    function bnTestBit(n) {
      var 
    Math.floor(n/this.DB);
      if(
    >= this.t) return(this.s!=0);
      return((
    this[j]&(1<<(n%this.DB)))!=0);
    }

    // (protected) this op (1<<n)
    function bnpChangeBit(n,op) {
      var 
    BigInteger.ONE.shiftLeft(n);
      
    this.bitwiseTo(r,op,r);
      return 
    r;
    }

    // (public) this | (1<<n)
    function bnSetBit(n) { return this.changeBit(n,op_or); }

    // (public) this & ~(1<<n)
    function bnClearBit(n) { return this.changeBit(n,op_andnot); }

    // (public) this ^ (1<<n)
    function bnFlipBit(n) { return this.changeBit(n,op_xor); }

    // (protected) r = this + a
    function bnpAddTo(a,r) {
      var 
    00Math.min(a.t,this.t);
      while(
    m) {
        
    += this[i]+a[i];
        
    r[i++] = c&this.DM;
        
    >>= this.DB;
      }
      if(
    a.this.t) {
        
    += a.s;
        while(
    this.t) {
          
    += this[i];
          
    r[i++] = c&this.DM;
          
    >>= this.DB;
        }
        
    += this.s;
      }
      else {
        
    += this.s;
        while(
    a.t) {
          
    += a[i];
          
    r[i++] = c&this.DM;
          
    >>= this.DB;
        }
        
    += a.s;
      }
      
    r.= (c<0)?-1:0;
      if(
    0r[i++] = c;
      else if(
    < -1r[i++] = this.DV+c;
      
    r.i;
      
    r.clamp();
    }

    // (public) this + a
    function bnAdd(a) { var nbi(); this.addTo(a,r); return r; }

    // (public) this - a
    function bnSubtract(a) { var nbi(); this.subTo(a,r); return r; }

    // (public) this * a
    function bnMultiply(a) { var nbi(); this.multiplyTo(a,r); return r; }

    // (public) this / a
    function bnDivide(a) { var nbi(); this.divRemTo(a,r,null); return r; }

    // (public) this % a
    function bnRemainder(a) { var nbi(); this.divRemTo(a,null,r); return r; }

    // (public) [this/a,this%a]
    function bnDivideAndRemainder(a) {
      var 
    nbi(), nbi();
      
    this.divRemTo(a,q,r);
      return new Array(
    q,r);
    }

    // (protected) this *= n, this >= 0, 1 < n < DV
    function bnpDMultiply(n) {
      
    this[this.t] = this.am(0,n-1,this,0,0,this.t);
      ++
    this.t;
      
    this.clamp();
    }

    // (protected) this += n << w words, this >= 0
    function bnpDAddOffset(n,w) {
      while(
    this.<= wthis[this.t++] = 0;
      
    this[w] += n;
      while(
    this[w] >= this.DV) {
        
    this[w] -= this.DV;
        if(++
    >= this.tthis[this.t++] = 0;
        ++
    this[w];
      }
    }

    // A "null" reducer
    function NullExp() {}
    function 
    nNop(x) { return x; }
    function 
    nMulTo(x,y,r) { x.multiplyTo(y,r); }
    function 
    nSqrTo(x,r) { x.squareTo(r); }

    NullExp.prototype.convert nNop;
    NullExp.prototype.revert nNop;
    NullExp.prototype.mulTo nMulTo;
    NullExp.prototype.sqrTo nSqrTo;

    // (public) this^e
    function bnPow(e) { return this.exp(e,new NullExp()); }

    // (protected) r = lower n words of "this * a", a.t <= n
    // "this" should be the larger one if appropriate.
    function bnpMultiplyLowerTo(a,n,r) {
      var 
    Math.min(this.t+a.t,n);
      
    r.0// assumes a,this >= 0
      
    r.i;
      while(
    0r[--i] = 0;
      var 
    j;
      for(
    r.t-this.tj; ++ir[i+this.t] = this.am(0,a[i],r,i,0,this.t);
      for(
    Math.min(a.t,n); j; ++ithis.am(0,a[i],r,i,0,n-i);
      
    r.clamp();
    }

    // (protected) r = "this * a" without lower n words, n > 0
    // "this" should be the larger one if appropriate.
    function bnpMultiplyUpperTo(a,n,r) {
      --
    n;
      var 
    r.this.t+a.t-n;
      
    r.0// assumes a,this >= 0
      
    while(-->= 0r[i] = 0;
      for(
    Math.max(n-this.t,0); a.t; ++i)
        
    r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);
      
    r.clamp();
      
    r.drShiftTo(1,r);
    }

    // Barrett modular reduction
    function Barrett(m) {
      
    // setup Barrett
      
    this.r2 nbi();
      
    this.q3 nbi();
      
    BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
      
    this.mu this.r2.divide(m);
      
    this.m;
    }

    function 
    barrettConvert(x) {
      if(
    x.|| x.2*this.m.t) return x.mod(this.m);
      else if(
    x.compareTo(this.m) < 0) return x;
      else { var 
    nbi(); x.copyTo(r); this.reduce(r); return r; }
    }

    function 
    barrettRevert(x) { return x; }

    // x = x mod m (HAC 14.42)
    function barrettReduce(x) {
      
    x.drShiftTo(this.m.t-1,this.r2);
      if(
    x.this.m.t+1) { x.this.m.t+1x.clamp(); }
      
    this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
      
    this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
      while(
    x.compareTo(this.r2) < 0x.dAddOffset(1,this.m.t+1);
      
    x.subTo(this.r2,x);
      while(
    x.compareTo(this.m) >= 0x.subTo(this.m,x);
    }

    // r = x^2 mod m; x != r
    function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }

    // r = x*y mod m; x,y != r
    function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }

    Barrett.prototype.convert barrettConvert;
    Barrett.prototype.revert barrettRevert;
    Barrett.prototype.reduce barrettReduce;
    Barrett.prototype.mulTo barrettMulTo;
    Barrett.prototype.sqrTo barrettSqrTo;

    // (public) this^e % m (HAC 14.85)
    function bnModPow(e,m) {
      var 
    e.bitLength(), knbv(1), z;
      if(
    <= 0) return r;
      else if(
    181;
      else if(
    483;
      else if(
    1444;
      else if(
    7685;
      else 
    6;
      if(
    8)
        
    = new Classic(m);
      else if(
    m.isEven())
        
    = new Barrett(m);
      else
        
    = new Montgomery(m);

      
    // precomputation
      
    var = new Array(), 3k1 k-1km = (1<<k)-1;
      
    g[1] = z.convert(this);
      if(
    1) {
        var 
    g2 nbi();
        
    z.sqrTo(g[1],g2);
        while(
    <= km) {
          
    g[n] = nbi();
          
    z.mulTo(g2,g[n-2],g[n]);
          
    += 2;
        }
      }

      var 
    e.t-1wis1 truer2 nbi(), t;
      
    nbits(e[j])-1;
      while(
    >= 0) {
        if(
    >= k1= (e[j]>>(i-k1))&km;
        else {
          
    = (e[j]&((1<<(i+1))-1))<<(k1-i);
          if(
    0|= e[j-1]>>(this.DB+i-k1);
        }

        
    k;
        while((
    w&1) == 0) { >>= 1; --n; }
        if((
    -= n) < 0) { += this.DB; --j; }
        if(
    is1) {    // ret == 1, don't bother squaring or multiplying it
          
    g[w].copyTo(r);
          
    is1 false;
        }
        else {
          while(
    1) { z.sqrTo(r,r2); z.sqrTo(r2,r); -= 2; }
          if(
    0z.sqrTo(r,r2); else { rr2r2 t; }
          
    z.mulTo(r2,g[w],r);
        }

        while(
    >= && (e[j]&(1<<i)) == 0) {
          
    z.sqrTo(r,r2); rr2r2 t;
          if(--
    0) { this.DB-1; --j; }
        }
      }
      return 
    z.revert(r);
    }

    // (public) gcd(this,a) (HAC 14.54)
    function bnGCD(a) {
      var 
    = (this.s<0)?this.negate():this.clone();
      var 
    = (a.s<0)?a.negate():a.clone();
      if(
    x.compareTo(y) < 0) { var xyt; }
      var 
    x.getLowestSetBit(), y.getLowestSetBit();
      if(
    0) return x;
      if(
    gi;
      if(
    0) {
        
    x.rShiftTo(g,x);
        
    y.rShiftTo(g,y);
      }
      while(
    x.signum() > 0) {
        if((
    x.getLowestSetBit()) > 0x.rShiftTo(i,x);
        if((
    y.getLowestSetBit()) > 0y.rShiftTo(i,y);
        if(
    x.compareTo(y) >= 0) {
          
    x.subTo(y,x);
          
    x.rShiftTo(1,x);
        }
        else {
          
    y.subTo(x,y);
          
    y.rShiftTo(1,y);
        }
      }
      if(
    0y.lShiftTo(g,y);
      return 
    y;
    }

    // (protected) this % n, n < 2^26
    function bnpModInt(n) {
      if(
    <= 0) return 0;
      var 
    this.DV%n= (this.s<0)?n-1:0;
      if(
    this.0)
        if(
    == 0this[0]%n;
        else for(var 
    this.t-1>= 0; --i= (d*r+this[i])%n;
      return 
    r;
    }

    // (public) 1/this % m (HAC 14.61)
    function bnModInverse(m) {
      var 
    ac m.isEven();
      if((
    this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
      var 
    m.clone(), this.clone();
      var 
    nbv(1), nbv(0), nbv(0), nbv(1);
      while(
    u.signum() != 0) {
        while(
    u.isEven()) {
          
    u.rShiftTo(1,u);
          if(
    ac) {
            if(!
    a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
            
    a.rShiftTo(1,a);
          }
          else if(!
    b.isEven()) b.subTo(m,b);
          
    b.rShiftTo(1,b);
        }
        while(
    v.isEven()) {
          
    v.rShiftTo(1,v);
          if(
    ac) {
            if(!
    c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
            
    c.rShiftTo(1,c);
          }
          else if(!
    d.isEven()) d.subTo(m,d);
          
    d.rShiftTo(1,d);
        }
        if(
    u.compareTo(v) >= 0) {
          
    u.subTo(v,u);
          if(
    aca.subTo(c,a);
          
    b.subTo(d,b);
        }
        else {
          
    v.subTo(u,v);
          if(
    acc.subTo(a,c);
          
    d.subTo(b,d);
        }
      }
      if(
    v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
      if(
    d.compareTo(m) >= 0) return d.subtract(m);
      if(
    d.signum() < 0d.addTo(m,d); else return d;
      if(
    d.signum() < 0) return d.add(m); else return d;
    }

    var 
    lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509];
    var 
    lplim = (1<<26)/lowprimes[lowprimes.length-1];

    // (public) test primality with certainty >= 1-.5^t
    function bnIsProbablePrime(t) {
      var 
    ithis.abs();
      if(
    x.== && x[0] <= lowprimes[lowprimes.length-1]) {
        for(
    0lowprimes.length; ++i)
          if(
    x[0] == lowprimes[i]) return true;
        return 
    false;
      }
      if(
    x.isEven()) return false;
      
    1;
      while(
    lowprimes.length) {
        var 
    lowprimes[i], i+1;
        while(
    lowprimes.length && lplim*= lowprimes[j++];
        
    x.modInt(m);
        while(
    j) if(m%lowprimes[i++] == 0) return false;
      }
      return 
    x.millerRabin(t);
    }

    // (protected) true if probably prime (HAC 4.24, Miller-Rabin)
    function bnpMillerRabin(t) {
      var 
    n1 this.subtract(BigInteger.ONE);
      var 
    n1.getLowestSetBit();
      if(
    <= 0) return false;
      var 
    n1.shiftRight(k);
      
    = (t+1)>>1;
      if(
    lowprimes.lengthlowprimes.length;
      var 
    nbi();
      for(var 
    0t; ++i) {
        
    a.fromInt(lowprimes[i]);
        var 
    a.modPow(r,this);
        if(
    y.compareTo(BigInteger.ONE) != && y.compareTo(n1) != 0) {
          var 
    1;
          while(
    j++ < && y.compareTo(n1) != 0) {
            
    y.modPowInt(2,this);
            if(
    y.compareTo(BigInteger.ONE) == 0) return false;
          }
          if(
    y.compareTo(n1) != 0) return false;
        }
      }
      return 
    true;
    }

    // protected
    BigInteger.prototype.chunkSize bnpChunkSize;
    BigInteger.prototype.toRadix bnpToRadix;
    BigInteger.prototype.fromRadix bnpFromRadix;
    BigInteger.prototype.fromNumber bnpFromNumber;
    BigInteger.prototype.bitwiseTo bnpBitwiseTo;
    BigInteger.prototype.changeBit bnpChangeBit;
    BigInteger.prototype.addTo bnpAddTo;
    BigInteger.prototype.dMultiply bnpDMultiply;
    BigInteger.prototype.dAddOffset bnpDAddOffset;
    BigInteger.prototype.multiplyLowerTo bnpMultiplyLowerTo;
    BigInteger.prototype.multiplyUpperTo bnpMultiplyUpperTo;
    BigInteger.prototype.modInt bnpModInt;
    BigInteger.prototype.millerRabin bnpMillerRabin;

    // public
    BigInteger.prototype.clone = bnClone;
    BigInteger.prototype.intValue bnIntValue;
    BigInteger.prototype.byteValue bnByteValue;
    BigInteger.prototype.shortValue bnShortValue;
    BigInteger.prototype.signum bnSigNum;
    BigInteger.prototype.toByteArray bnToByteArray;
    BigInteger.prototype.equals bnEquals;
    BigInteger.prototype.min bnMin;
    BigInteger.prototype.max bnMax;
    BigInteger.prototype.and = bnAnd;
    BigInteger.prototype.or = bnOr;
    BigInteger.prototype.xor = bnXor;
    BigInteger.prototype.andNot bnAndNot;
    BigInteger.prototype.not bnNot;
    BigInteger.prototype.shiftLeft bnShiftLeft;
    BigInteger.prototype.shiftRight bnShiftRight;
    BigInteger.prototype.getLowestSetBit bnGetLowestSetBit;
    BigInteger.prototype.bitCount bnBitCount;
    BigInteger.prototype.testBit bnTestBit;
    BigInteger.prototype.setBit bnSetBit;
    BigInteger.prototype.clearBit bnClearBit;
    BigInteger.prototype.flipBit bnFlipBit;
    BigInteger.prototype.add bnAdd;
    BigInteger.prototype.subtract bnSubtract;
    BigInteger.prototype.multiply bnMultiply;
    BigInteger.prototype.divide bnDivide;
    BigInteger.prototype.remainder bnRemainder;
    BigInteger.prototype.divideAndRemainder bnDivideAndRemainder;
    BigInteger.prototype.modPow bnModPow;
    BigInteger.prototype.modInverse bnModInverse;
    BigInteger.prototype.pow bnPow;
    BigInteger.prototype.gcd bnGCD;
    BigInteger.prototype.isProbablePrime bnIsProbablePrime;

    // BigInteger interfaces not implemented in jsbn:

    // BigInteger(int signum, byte[] magnitude)
    // double doubleValue()
    // float floatValue()
    // int hashCode()
    // long longValue()
    // static BigInteger valueOf(long val) 
    Ich habe schon diverse Sachen mit 3rdparty libs probiert, die aber alle nicht funktioniert haben. Hier ist mein letzter Versuch. Ich benutze hier in diesen Beispiel "phpseclib" Was mache ich falsch?
    PHP-Code:
    <?php
        
    if(!class_exists("Crypt_RSA")) {
            include(
    "phpseclib/Crypt/RSA.php");
        }
        if(!
    class_exists("Math_BigInteger")) {
            include(
    "phpseclib/Math/BigInteger.php");
        }

        
    $login "******************";
        
    $password "****************";

        function 
    geturl($url$ref$cookie$postdata$header, &$info, &$output)
        {
            
    $ch curl_init();
            
    curl_setopt($chCURLOPT_URL$url);
            
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
            
    curl_setopt ($chCURLOPT_SSL_VERIFYPEER0);
            
    curl_setopt ($chCURLOPT_SSL_VERIFYHOST0);
            if (
    $ref)
            {
                
    curl_setopt($chCURLOPT_REFERER$ref);
            }
            if (
    $cookie)
            {
                
    curl_setopt($chCURLOPT_COOKIE$cookie);
            }

            if (
    $postdata)
            {
                
    curl_setopt($chCURLOPT_POSTtrue);
                
    $postStr "";
                foreach (
    $postdata as $key => $value)
                {
                    if (
    $postStr)
                        
    $postStr .= "&";
                    
    $postStr .= $key "=" $value;
                }
                
    curl_setopt($chCURLOPT_POSTFIELDS$postStr);
            }

            
    curl_setopt($chCURLOPT_HEADER$header);
            
    $info curl_getinfo($ch);
            
    $output curl_exec($ch);
            
    curl_close($ch);
        }
        
    geturl("https://steamcommunity.com/login/getrsakey"nullnull, array('username' => $login), 0$info$output);
        
    $data json_decode($outputtrue);

        if (
    $data['success'] === true)
        {
            
    $publickey_exp $data['publickey_exp'];
            
    $publickey_mod $data['publickey_mod'];
            
    $RSA = new Crypt_RSA();
            
    $RSA->setEncryptionMode(CRYPT_RSA_ENCRYPTION_PKCS1);
            
    $n = new Math_BigInteger($publickey_mod16);
            
    $e = new Math_BigInteger($publickey_exp16);

            
    $key = array("modulus"=>$n"publicExponent"=>$e);
            
    $RSA->loadKey($keyCRYPT_RSA_PUBLIC_FORMAT_RAW);
            
    $encryptedPassword base64_encode($RSA->encrypt($passwordfalse));
            
    $captchaGid = -1;
            
    $captchaText;
            
    $emailAuth;
            
    $emailSteamId;

            
    $params = array(
                
    'username' => $login,
                
    'password' => $encryptedPassword,
                
    'rsatimestamp' => $data['timestamp'],
                
    'captcha_gid' => $captchaGid,
                
    'captcha_text' => $captchaText,
                
    'emailauth' => $emailAuth,
                
    'emailsteamid' => $emailSteamId
            
    );
            
    geturl("https://steamcommunity.com/login/dologin/"nullnull$params0$info$output);
            
    $data json_decode($outputtrue);
            
    var_dump($data);
            if (
    $data['captcha_needed'])
            {
                
    $captchaGid $data['captcha_gid'];
                echo 
    '<img src="https://steamcommunity.com/public/captcha.php?gid=' $captchaGid '">';
            }
        }
    Wie würdet ihr die Methode RSA.encrypt() in PHP schreiben?

  • #2
    Ich finde, du solltest noch mehr Code posten, das verbessert den Fokus auf das eigentliche Problem.

    Kommentar


    • #3
      Warum willst du dich auf deren Webseite einloggen? Abgesehen davon, das das ganze wahrscheinlich gegen deren Nutzungsbedingungen verstößt, sollte die API doch um einiges angenehmer sein.

      http://steamcommunity.com/dev?l=german
      Zitat von nikosch
      Naja, anscheinend spricht die Steckdose kein HTTP. LOL

      Kommentar


      • #4
        Wie soll einloggen gegen die Nutzungsbedingungen verstoßen? Mein Zeil ist es wenn die Internetseite eingeloggt ist (die Cookies abgespeichert sind) einen TradeBot zu machen. Und Handeln ist nicht in der API enthalten. Also geht das nur auf diese Weise

        Kommentar


        • #5
          Schau dir mal fop/goutte an

          Kommentar


          • #6
            Zitat von rkr Beitrag anzeigen
            Schau dir mal fop/goutte an
            Wenn ich das auf die schnelle richtig verstanden habe sind das nur libs, die den Login machen. Mein Problem ist aber nicht der POST Request, sondern die Verschlüsselung

            Kommentar


            • #7
              Sorry, ich war unterwegs und habe deinen Beitrag nicht richtig gelesen. Wenn Valve etwas an dem Algorithmus ändert, dann musst du diese Änderungen auch an php übertragen. Ich wurde daher einfach die Js files von Steam nehmen und via V8 abspielen.

              Wenn das nicht geht, oder zu komplex ist, dann würde ich das unter Linux einfach mit SeleniumServer machen. Da kannst du mit einem ferngesteuerten Firefox alle Aktionen durchführen, die du als User durchführen kannst, hast aber ständig nebenher noch Zugriff auf den Quellcode und kannst eben diesen Via xpath inspizieren. Du brauchst auch keinen Desktop dafür (falls sich die Idee aufdrängt)

              Kommentar

              Lädt...
              X