bRO's client asking for PIN Code on log in

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

Message
Author
Kurama
Noob
Noob
Posts: 19
Joined: 13 Dec 2012, 17:26
Noob?: No

Re: bRO's client asking for PIN Code on log in

#131 Post by Kurama »

Code: Select all

use warnings;
use strict;
use Math::BigInt;

sub decrypt
{
  my $holdrand = $_[1];
  $holdrand =  Math::BigInt->new($holdrand);
  my $mulfactor = 0x3498;
  my $addfactor = 0x881234;
  my $StrLen = $_[0];
  my @sequence = ('0','1','2','3','4','5','6','7','8','9');
  if ($StrLen >= 1) 
  {
    my $k = 2;
    for (my $pos = int 1; $pos < 10; $pos++) 
    {
      $holdrand = $addfactor + $holdrand * $mulfactor & 0xFFFFFFFF;
      my $replace_pos = $holdrand % $k;
      if ($pos != $replace_pos)
      {	 
        my $temp = $sequence[$pos];
        $sequence[$pos] = $sequence[$replace_pos];
        $sequence[$replace_pos] = $temp;
      }
     $k++;
    }
  }
 my $pin = $_[2];
 my $add = '';
 my @pinzim = split('',$pin);
 for (my $pos = int 0;  $pos<length($pin); $pos++) 
 {
   for (my $i = int 0; $i<10;$i++)
   {
     if ($pinzim[$pos] eq $sequence[$i]) 
     {
       $add = $add.($i+30);
     }
   }
 }
return $add;
}

print decrypt(10,0x124ad78e,2404);
Credits: Kurama, ever_boy_, kLabMouse and Iniro.

iMikeLance
Moderators
Moderators
Posts: 208
Joined: 01 Feb 2010, 17:37
Noob?: No
Location: Brazil - MG
Contact:

Re: bRO's client asking for PIN Code on log in

#132 Post by iMikeLance »

Got it working by changing some of Kurama's/kLab's code. I'll just do some cleaning and then I can post it here.

ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

Re: bRO's client asking for PIN Code on log in

#133 Post by ever_boy_ »

bRO's PIN keyboard successfully decripted. will be commited soon.
thanks EternalHarvest and kLabMouse for all your support.

nizdi
Human
Human
Posts: 26
Joined: 19 Oct 2012, 23:31
Noob?: No

Re: bRO's client asking for PIN Code on log in

#134 Post by nizdi »

Kurama wrote:

Code: Select all

use warnings;
use strict;
use Math::BigInt;

sub decrypt
{
  my $holdrand = $_[1];
  $holdrand =  Math::BigInt->new($holdrand);
  my $mulfactor = 0x3498;
  my $addfactor = 0x881234;
  my $StrLen = $_[0];
  my @sequence = ('0','1','2','3','4','5','6','7','8','9');
  if ($StrLen >= 1) 
  {
    my $k = 2;
    for (my $pos = int 1; $pos < 10; $pos++) 
    {
      $holdrand = $addfactor + $holdrand * $mulfactor & 0xFFFFFFFF;
      my $replace_pos = $holdrand % $k;
      if ($pos != $replace_pos)
      {	 
        my $temp = $sequence[$pos];
        $sequence[$pos] = $sequence[$replace_pos];
        $sequence[$replace_pos] = $temp;
      }
     $k++;
    }
  }
 my $pin = $_[2];
 my $add = '';
 my @pinzim = split('',$pin);
 for (my $pos = int 0;  $pos<length($pin); $pos++) 
 {
   for (my $i = int 0; $i<10;$i++)
   {
     if ($pinzim[$pos] eq $sequence[$i]) 
     {
       $add = $add.($i+30);
     }
   }
 }
return $add;
}

print decrypt(10,0x124ad78e,2404);
Credits: Kurama, ever_boy_, kLabMouse and Iniro.
Sorry for ress, but, what should I do with this code?

ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

Re: bRO's client asking for PIN Code on log in

#135 Post by ever_boy_ »

use this as a decrypting sub in send\bRO.pm.
or wait till the commit is ready.


User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: bRO's client asking for PIN Code on log in

#137 Post by kLabMouse »

Only bRO ? this thing is new. Should be in ST0.

iMikeLance
Moderators
Moderators
Posts: 208
Joined: 01 Feb 2010, 17:37
Noob?: No
Location: Brazil - MG
Contact:

Re: bRO's client asking for PIN Code on log in

#138 Post by iMikeLance »

kLabMouse wrote:
Only bRO ? this thing is new. Should be in ST0.
Should I replace the existing PIN support for mRO inside ST0 then? I can do it tomorrow

User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: bRO's client asking for PIN Code on log in

#139 Post by kLabMouse »

iMikeLance wrote:
kLabMouse wrote:
Only bRO ? this thing is new. Should be in ST0.
Should I replace the existing PIN support for mRO inside ST0 then? I can do it tomorrow
No. add a SideBySide one.
Old one was also by Request. So it should change some global key on what system to use based on first Incoming packet.

Fat4LitY
Noob
Noob
Posts: 14
Joined: 03 Sep 2012, 17:51
Noob?: No

Re: bRO's client asking for PIN Code on log in

#140 Post by Fat4LitY »

I didn't understand this procedure fr3dbr maked, why sometimes Kore exchange 08B8/08B9 packets several times and sometimes he exchange just a few?

Post Reply