Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 07-15-2020, 16:14
wassim_ wassim_ is offline
Friend
 
Join Date: Nov 2002
Posts: 104
Rept. Given: 1
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 14
Thanks Rcvd at 10 Times in 4 Posts
wassim_ Reputation: 2
Idenitfying a cryptographic algorithm

I need help identifying this decryption algorithm, the argument "s" in the function d3 is the encrypted string.
If this is a known algorithm, I would like to get the algorithm to write the encrypted string "s" myslef.

Code:
function d3(s)
   {
      var _loc4_ = s.substr(0,11);
      var _loc9_ = Number(_loc4_.substr(10,1));
      var _loc3_ = Number(_loc4_.substr(_loc9_,2));
      var _loc7_ = s.substr(22,_loc3_);
      var _loc10_ = String(s.substr(11,11));
      var _loc8_ = Number(s.substr(21,1));
      var _loc6_ = Number(s.substr(11 + _loc8_,2));
      var _loc5_ = s.substr(22 + _loc3_,s.length - (22 + _loc3_));
      return this.d(_loc7_,_loc6_,_loc5_);
   }
   function d(a, k, s)
   {
      return this.t(a,- k,s);
   }
   function t(a, k, s)
   {
      var _loc8_ = undefined;
      var _loc3_ = "";
      var _loc4_ = s.length;
      var _loc2_ = 0;
      while(_loc2_ < _loc4_)
      {
         _loc3_ = _loc3_ + this.r(a,s.charAt(_loc2_),k);
         _loc2_ = _loc2_ + 1;
      }
      return _loc3_;
   }
   function r(a, c, k)
   {
      var _loc2_ = a.indexOf(c);
      var _loc1_ = a.length;
      if(_loc2_ != -1)
      {
         return a.charAt((_loc2_ + k + _loc1_) % _loc1_);
      }
      return c;
   }
Reply With Quote
  #2  
Old 07-15-2020, 22:15
chants chants is offline
VIP
 
Join Date: Jul 2016
Posts: 725
Rept. Given: 35
Rept. Rcvd 48 Times in 30 Posts
Thanks Given: 666
Thanks Rcvd at 1,053 Times in 478 Posts
chants Reputation: 48
I think if you rewrote and cleaned up that code, it would be easier. It appears not as a much of a cryptographic algorithm as some simple string manipulation code. It can be a single function with a loop having a single condition inside of it. After cleaning it up, figuring out how to invert the function should be somewhat straight forward.
Reply With Quote
The Following User Says Thank You to chants For This Useful Post:
niculaita (07-16-2020)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Public White-Box Cryptographic Implementations and their Practical Attacks TechLord General Discussion 8 12-20-2016 08:03
Is this RSA algorithm? bridgeic General Discussion 30 08-09-2014 23:48
Any one see this Cryptographic? winndy General Discussion 17 10-19-2005 09:57


All times are GMT +8. The time now is 22:30.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )