Eikonal Blog

2010.01.28

Cisco “password 7” decryption – Perl code

Filed under: infosec — Tags: , , , — sandokan65 @ 17:19

Source: somewhere from the web.

#!/usr/bin/perl -w
# $Id: ios7decrypt.pl,v 1.1 1998/01/11 21:31:12 mesrik Exp $
#
# Credits for orginal code and description hobbit@avian.org,
# SPHiXe, .mudge et al. and for John Bashinski 
# for Cisco IOS password encryption facts.
#
# Use for any malice or illegal purposes strictly prohibited!
#

@xlat = ( 0x64, 0x73, 0x66, 0x64, 0x3b, 0x6b, 0x66, 0x6f, 0x41,
          0x2c, 0x2e, 0x69, 0x79, 0x65, 0x77, 0x72, 0x6b, 0x6c,
          0x64, 0x4a, 0x4b, 0x44, 0x48, 0x53 , 0x55, 0x42 );

while () {
        if (/(password|md5)\s+7\s+([\da-f]+)/io) {
            if (!(length($2) & 1)) {
                $ep = $2; $dp = "";
                ($s, $e) = ($2 =~ /^(..)(.+)/o);
                for ($i = 0; $i < length($e); $i+=2) {
                    $dp .= sprintf "%c",hex(substr($e,$i,2))^$xlat[$s++];
                }
                s/7\s+$ep/$dp/;
            }
        }
        print;
}


Related: https://eikonal.wordpress.com/2010/05/21/cisco-%e2%80%9cpassword-7%e2%80%b3/

Advertisements

BCS (Baker–Campbell–Hausdorff) formula

Filed under: Uncategorized — Tags: , — sandokan65 @ 17:12

In this posting the matrix C(t) is defined by e^{C(t)}:\equiv e^{t(A+B)} where A and B are constant matrices.

The Baker–Campbell–Hausdorff theorem claims that:

C(t) = B + \int_0^1  dt g(e^{t a} e^b ) A,

where g(z):\equiv \frac{\ln(z)}{z-1} = \sum_{m=0}^\infty \frac{(1-z)^m}{m+1}, and the lower-case letters a and b represent the adjoint actions of the corresponding matrices A and B (e.g. a X:\equiv ad(A) X :\equiv [A,X]).

One is frequently seeing the following series expression:

C(t) = t (A+B) + \frac{t^2}2 [A,B] + \frac{t^3}{12} ([[A.B],B]-[[A,B],A]) + \cdots = t (A+B) + \frac{t^2}2 a B + \frac{t^3}{12} (b^2 A + a^2 B) + \cdots


Source: T1269 = A.N.Richmond “Expansion for the exponential of a sum of matrices”; Int. Journal of Control (issue and year unknown).

The Trotter Formula

Filed under: mathematics — Tags: — sandokan65 @ 17:02

e^{t(A+B)} = \lim_{m\rightarrow \infty} \left(e^{\frac{t}{m}A}e^{\frac{t}{m}B}\right)^m.


Source: T1269 = A.N.Richmond “Expansion for the exponential of a sum of matrices”; Int. Journal of Control (issue and year unknown).

The Zassenhaus formula

Filed under: mathematics — Tags: , — sandokan65 @ 16:49

e^{A+B} = e^{A}e^{B}e^{C_2}e^{C_3}\cdots
where

  • C_2 = -\frac12 [A,B] = -\frac12 a B,
  • C_3 = -\frac13 [[A,B],B] - \frac16 [[A,B],A] = -\frac13 b^2 A + \frac16 a^2 B, etc.

Here, as elsewhere on this site, I am using notation a:\equiv ad(A) etc.


Sources:

  • T1264 = W. Magnus “On the exponential solution of differential equations for a linear operator”; Communications of Pure and Applied mathematcis, Vol VII, 6490673 (1954).
  • T1269 = A.N.Richmond “Expansion for the exponential of a sum of matrices”; Int. Journal of Control (issue and year unknown).

Bookmarklets

Filed under: web tools — Tags: , , , , , — sandokan65 @ 15:24

The most useful bookmarklets:

  • Wayback archive bookmarklet (http://www.archive.org/web/web.php):
    javascript:location.href='http://web.archive.org/web/*/'+document.location.href;
    
  • TinyURL bookmarklet (Source: http://tinyurl.com/#toolbar):
    javascript:void(location.href='http://tinyurl.com/create.php?url='+location.href)
    
  • All-In-One Video bookmarklet: http://1024k.de/bookmarklets/video-bookmarklets.html
  • WordPress.com PressThis bookmarklet:
    javascript:
    var d=document, w=window, e=w.getSelection, k=d.getSelection, x=d.selection,
    var s=(e?e():(k)?k():(x?x.createRange().text:0)),
    var f='https://eikonal.wordpress.com/wp-admin/press-this.php',
    var l=d.location, e=encodeURIComponent, 
    u=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=4';
    
    a=function(){
       if (!w.open(u,'t','toolbar=0,resizable=1,scrollbars=1,status=1,width=720,height=570'))
            l.href=u;
       };
       if (/Firefox/.test(navigator.userAgent))
           setTimeout(a,0);
       else
         a();
         void(0)
    

Articles


Library

  • Encipher.It – AES Text encryptor for Google Mail or anything else – https://encipher.it/:
    • Code:
        javascript:(
        function(){
         document.body.appendChild(document.createElement('script')).src='https://encipher.it/javascripts/inject.v2.js';
        }
        )();
        
    • “How To Encrypt Your Gmail & Facebook Messages” by Steve Campbell (MakeUseOf; 2011.09.13) – http://www.makeuseof.com/tag/encrypt-gmail-facebook-messages/
  • GmailThis! bookmarklet (2010.09.10):
    javascript:
    popw='';
    Q='';
    x=document;
    y=window;
    if(x.selection)%20{Q=x.selection.createRange().text;}
    %20else%20if%20(y.getSelection)%20{Q=y.getSelection();}
    %20else%20if%20(x.getSelection)%20{Q=x.getSelection();}
    popw%20=%20y.open('https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=&
    su='%20+%20escape(document.title)%20+%20'&body='%20+%20escape(Q)%20+%20escape('\n')%20+%20escape(location.href)%20+%20'&
    zx=RANDOMCRAP&
    shva=1&
    disablechatbrowsercheck=1&
    ui=1','gmailForm','scrollbars=yes,width=680,height=510,top=175,left=75,status=no,resizable=yes');
    if%20(!document.all)%20T%20=%20setTimeout('popw.focus()',50);void(0);
    
  • GmailThis! bookmarklet (old):
    javascript:
    popw='';
    Q='';
    x=document;
    y=window;
    if(x.selection)%20{Q=x.selection.createRange().text;}
    %20else%20if%20(y.getSelection)%20{Q=y.getSelection();}
    %20else%20if%20(x.getSelection)%20{Q=x.getSelection();}
    popw%20=%20y.open('https://mail.google.com/mail?view=cm&tf=0&to=&
    su='%20+%20escape(document.title)%20+%20'&body='%20+%20escape(Q)%20+%20escape('\n')%20+%20escape(location.href),'gmailForm',
    'scrollbars=yes,width=680,height=510,top=175,left=75,status=no,resizable=yes');
    if%20(!document.all)%20T%20=%20setTimeout('popw.focus()',50);void(0);
    

Astronomic tables and calculators

Filed under: Uncategorized — Tags: , , , — sandokan65 @ 15:11

Related here: Astronomy & Astrophysics – https://eikonal.wordpress.com/2011/05/09/astronomy-astrophysics/ | Astronomic tables and calculators – https://eikonal.wordpress.com/2010/01/28/astronomic-tables-and-calculators/ | Solar planetary system – https://eikonal.wordpress.com/2011/02/17/solar-planetary-system/ | Inside black holes – https://eikonal.wordpress.com/2011/04/12/inside-black-holes/ | Physics Sites – https://eikonal.wordpress.com/2010/02/12/physics-sites/

Blog at WordPress.com.