[18845] 2017-09-21_ctf之凯撒解密

文档创建者:s7ckTeam
浏览次数:16
最后更新:2025-01-18
2017-09-21_ctf之凯撒解密 c t f c r h u a   h u a s e c   2 0 1 7 - 0 9 - 2 1 0 x 0 0           c t f   0 x 0 1   使 使         . / k a i s a . p y         /                               . / k a i s a . p y       l e f t     5     X M C P V 0 x 0 3   # ! / u s r / b i n / p y t h o n # ! - * - c o d i n g : u t f 8 - * - i m p o r t   s y s i f   ( l e n ( s y s . a r g v ) )   <   4 :         p r i n t   " U s a g e : . / k a i s a . p y   < l e f t / r i g h t >   < n u m >   < c r y p t o t e x t > "         p r i n t   " E x a m p l e : . / k a i s a . p y     l e f t   2   T H V W T P "         s y s . e x i t ( ) l o c   =   s y s . a r g v [ 1 ] n u m   =   s y s . a r g v [ 2 ] c r y p t o   =   s y s . a r g v [ 3 ] a l i s t   =   [ ' A ' , ' B ' , ' C ' , ' D ' , ' E ' , ' F ' , ' G ' , ' H ' , ' I ' , ' J ' , ' K ' , ' L ' , ' M ' , ' N ' , ' O ' , ' P ' , ' Q ' , ' R ' , ' S ' , ' T ' , ' U ' , ' V ' , ' W ' , ' X ' , ' Y ' , ' Z ' ] i f   ( l o c   = =   " l e f t " ) :         f o r   i   i n   c r y p t o . u p p e r ( ) :                 i f   ( i   n o t   i n   a l i s t ) :                         p r i n t   " i t   c a n ' t   b e   d e c o d e "                         s y s . e x i t ( )                 e l s e :                         f o r   j   i n   a l i s t :                                 i f   ( i   = =   j ) :                                         n   =   a l i s t . i n d e x ( j )                                         m   =   i n t ( n   -   i n t ( n u m ) )                                         i f   ( m   <   0 ) :                                                 m   =   2 6   +   m                                                 p r i n t   a l i s t [ m ] ,                                         e l s e :                                                 p r i n t   a l i s t [ m ] , i f   ( l o c   = =   " r i g h t " ) :         f o r   i   i n   c r y p t o . u p p e r ( ) :                 i f   ( i   n o t   i n   a l i s t ) :                         p r i n t   " i t   c a n ' t   b e   d e c o d e "                         s y s . e x i t                 e l s e :                         f o r   j   i n   a l i s t :
                                i f   ( i   = =   j ) :                                         n   =   a l i s t . i n d e x ( j )                                         m   =   i n t ( n   +   i n t ( n u m ) )                                         i f   ( m   >   2 5 ) :                                                 m   =   m   -   2 5                                                 p r i n t   a l i s t [ m ] ,                                         e l s e :                                                 p r i n t   a l i s t [ m ] ,       h t t p s : / / g i t h u b . c o m / c r h u a / k a i s a . g i t
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则