How can I get the n/e/d

Detox

Member
Jul 24, 2010
365
24
I used AS3 Sorcerer to get the Script but now I'm trying to figure out how to get the n/e/d
:S

I'm trying to get n/e/d
@Sledmore
@Thom
Code:
//------------------------------------------------------------
//_-3ht.RSAKey

package _-3ht
{
    import _-24e.BigInteger;
    import _-2y5.Random;
    import flash.utils.ByteArray;
    import _-2MF._-2kQ;

    public class RSAKey
    {

        public var e:int;
        public var n:BigInteger;
        public var d:BigInteger;
        public var p:BigInteger;
        public var q:BigInteger;
        public var _-e3:BigInteger;
        public var _-0Tm:BigInteger;
        public var _-3Xd:BigInteger;
        protected var _-4nQ:Boolean;
        protected var _-3jw:Boolean;

        public function RSAKey(_arg1:BigInteger, _arg2:int, _arg3:BigInteger=null, _arg4:BigInteger=null, _arg5:BigInteger=null, _arg6:BigInteger=null, _arg7:BigInteger=null, _arg8:BigInteger=null)
        {
            this.n = _arg1;
            this.e = _arg2;
            this.d = _arg3;
            this.p = _arg4;
            this.q = _arg5;
            this._-e3 = _arg6;
            this._-0Tm = _arg7;
            this._-3Xd = _arg8;
            this._-3jw = ((!((this.n == null))) && (!((this.e == 0))));
            this._-4nQ = ((this._-3jw) && (!((this.d == null))));
        }

        public static function _-2RQ(_arg1:String, _arg2:String):RSAKey
        {
            return (new RSAKey(new BigInteger(_arg1, 16), parseInt(_arg2, 16)));
        }

        public static function _-3It(_arg1:String, _arg2:String, _arg3:String, _arg4:String=null, _arg5:String=null, _arg6:String=null, _arg7:String=null, _arg8:String=null):RSAKey
        {
            if (_arg4 == null){
                return (new RSAKey(new BigInteger(_arg1, 16), parseInt(_arg2, 16), new BigInteger(_arg3, 16)));
            };
            return (new RSAKey(new BigInteger(_arg1, 16), parseInt(_arg2, 16), new BigInteger(_arg3, 16), new BigInteger(_arg4, 16), new BigInteger(_arg5, 16), new BigInteger(_arg6, 16), new BigInteger(_arg7), new BigInteger(_arg8)));
        }

        public static function _-3KD(_arg1:uint, _arg2:String):RSAKey
        {
            var k:BigInteger;
            var k:BigInteger;
            var k:BigInteger;
            var k:BigInteger;
            var k:Random = new Random();
            var k:uint = (_arg1 >> 1);
            var k:RSAKey = new RSAKey(null, 0, null);
            k.e = parseInt(_arg2, 16);
            var k:BigInteger = new BigInteger(_arg2, 16);
            while (true) {
                while (true) {
                    k.p = _-4mt((_arg1 - k), k);
                    if ((((k.p.subtract(BigInteger._-0Rr)._-0Dt(k)._-05J(BigInteger._-0Rr) == 0)) && (k.p._-0d0(10)))) break;
                };
                while (true) {
                    k.q = _-4mt(k, k);
                    if ((((k.q.subtract(BigInteger._-0Rr)._-0Dt(k)._-05J(BigInteger._-0Rr) == 0)) && (k.q._-0d0(10)))) break;
                };
                if (k.p._-05J(k.q) <= 0){
                    k = k.p;
                    k.p = k.q;
                    k.q = k;
                };
                k = k.p.subtract(BigInteger._-0Rr);
                k = k.q.subtract(BigInteger._-0Rr);
                k = k._-4-f(k);
                if (k._-0Dt(k)._-05J(BigInteger._-0Rr) == 0){
                    k.n = k.p._-4-f(k.q);
                    k.d = k._-5-y(k);
                    k._-e3 = k.d.mod(k);
                    k._-0Tm = k.d.mod(k);
                    k._-3Xd = k.q._-5-y(k.p);
                    break;
                };
            };
            return (k);
        }

        protected static function _-4mt(_arg1:int, _arg2:Random):BigInteger
        {
            if (_arg1 < 2){
                return (BigInteger._-0rL(1));
            };
            var k:ByteArray = new ByteArray();
            _arg2._-2Yw(k, (_arg1 >> 3));
            k.position = 0;
            var k:BigInteger = new BigInteger(k);
            k._-1x6(_arg1, 1);
            return (k);
        }


        public function _-3da():uint
        {
            return (((this.n._-52c() + 7) / 8));
        }

        public function dispose():void
        {
            this.e = 0;
            this.n.dispose();
            this.n = null;
            _-2kQ._-1HT();
        }

        public function _-FZ(_arg1:ByteArray, _arg2:ByteArray, _arg3:uint, _arg4:Function=null):void
        {
            this._-04C(this._-3K0, _arg1, _arg2, _arg3, _arg4, 2);
        }

        public function _-2bG(_arg1:ByteArray, _arg2:ByteArray, _arg3:uint, _arg4:Function=null):void
        {
            this._-5kt(this.doPrivate2, _arg1, _arg2, _arg3, _arg4, 2);
        }

        public function sign(_arg1:ByteArray, _arg2:ByteArray, _arg3:uint, _arg4:Function=null):void
        {
            this._-04C(this.doPrivate2, _arg1, _arg2, _arg3, _arg4, 1);
        }

        public function verify(_arg1:ByteArray, _arg2:ByteArray, _arg3:uint, _arg4:Function=null):void
        {
            this._-5kt(this._-3K0, _arg1, _arg2, _arg3, _arg4, 1);
        }

        private function _-04C(_arg1:Function, _arg2:ByteArray, _arg3:ByteArray, _arg4:uint, _arg5:Function, _arg6:int):void
        {
            var k:BigInteger;
            var k:BigInteger;
            if (_arg5 == null){
                k = this.pkcs1pad;
            };
            if (_arg2.position >= _arg2.length){
                _arg2.position = 0;
            };
            var k:uint = this._-3da();
            var k:int = (_arg2.position + _arg4);
            while (_arg2.position < k) {
                k = new BigInteger(_arg5(_arg2, k, k, _arg6), k);
                k = _arg1(k);
                k._-4Wq(_arg3);
            };
        }

        private function _-5kt(_arg1:Function, _arg2:ByteArray, _arg3:ByteArray, _arg4:uint, _arg5:Function, _arg6:int):void
        {
            var k:BigInteger;
            var k:BigInteger;
            var k:ByteArray;
            if (_arg5 == null){
                k = this.pkcs1unpad;
            };
            if (_arg2.position >= _arg2.length){
                _arg2.position = 0;
            };
            var k:uint = this._-3da();
            var k:int = (_arg2.position + _arg4);
            while (_arg2.position < k) {
                k = new BigInteger(_arg2, _arg4);
                k = _arg1(k);
                k = _arg5(k, k);
                _arg3.writeBytes(k);
            };
        }

        private function pkcs1pad(_arg1:ByteArray, _arg2:int, _arg3:uint, _arg4:uint=2):ByteArray
        {
            var k:int;
            var k:ByteArray = new ByteArray();
            var k:uint = _arg1.position;
            k = Math.min(_arg2, _arg1.length, ((k + _arg3) - 11));
            _arg1.position = k;
            var k:int = (k - 1);
            while ((((k >= k)) && ((_arg3 > 11)))) {
                var _local10 = --k;
                k[_local10] = _arg1[k--];
            };
            _local10 = --k;
            k[_local10] = 0;
            var k:Random = new Random();
            while (k > 2) {
                k = 0;
                while (k == 0) {
                    k = (((_arg4)==2) ? k._-1PG() : 0xFF);
                };
                var _local11 = --k;
                k[_local11] = k;
            };
            _local11 = --k;
            k[_local11] = _arg4;
            var _local12 = --k;
            k[_local12] = 0;
            return (k);
        }

        private function pkcs1unpad(_arg1:BigInteger, _arg2:uint, _arg3:uint=2):ByteArray
        {
            var k:ByteArray = _arg1._-3-E();
            var k:ByteArray = new ByteArray();
            k.position = 0;
            var k:int;
            while ((((k < k.length)) && ((k[k] == 0)))) {
                k++;
            };
            if (((!(((k.length - k) == (_arg2 - 1)))) || ((k[k] > 2)))){
                return (null);
            };
            k++;
            while (k[k] != 0) {
                ++k;
                if (k >= k.length){
                    return (null);
                };
            };
            while (++k < k.length) {
                k.writeByte(k[k]);
            };
            k.position = 0;
            return (k);
        }

        private function _-4LW(_arg1:ByteArray, _arg2:int, _arg3:uint):ByteArray
        {
            return (_arg1);
        }

        public function toString():String
        {
            return ("rsa");
        }

        protected function _-3K0(_arg1:BigInteger):BigInteger
        {
            return (_arg1._-l5(this.e, this.n));
        }

        protected function doPrivate2(_arg1:BigInteger):BigInteger
        {
            if ((((this.p == null)) && ((this.q == null)))){
                return (_arg1._-13Q(this.d, this.n));
            };
            var k:BigInteger = _arg1.mod(this.p)._-13Q(this._-e3, this.p);
            var k:BigInteger = _arg1.mod(this.q)._-13Q(this._-0Tm, this.q);
            while (k._-05J(k) < 0) {
                k = k.add(this.p);
            };
            var k:BigInteger = k.subtract(k)._-4-f(this._-3Xd).mod(this.p)._-4-f(this.q).add(k);
            return (k);
        }

        protected function _-5jn(_arg1:BigInteger):BigInteger
        {
            if ((((this.p == null)) || ((this.q == null)))){
                return (_arg1._-13Q(this.d, this.n));
            };
            var k:BigInteger = _arg1.mod(this.p)._-13Q(this._-e3, this.p);
            var k:BigInteger = _arg1.mod(this.q)._-13Q(this._-0Tm, this.q);
            while (k._-05J(k) < 0) {
                k = k.add(this.p);
            };
            return (k.subtract(k)._-4-f(this._-3Xd).mod(this.p)._-4-f(this.q).add(k));
        }


    }
}//package _-3ht
 

Users who are viewing this thread

Top