English
Source / code snippets

ruddy13 Verschlüsselung

 

Michael
Wodrich
The from some Mail-Programs and NewsReadern known ROT13-Verschlüsselung.
not as good Verschlüsselung virtual, separate circa Texts temporarily To hide.
Z.B. if over soccer-Results chat becomes its radiation first on the evening results. or someone has a TV-series already in america seen and wants above diskutieren. with ROT13 hidden is it each freigestellt, itself self whom Fun To spoil and the Text To reading or rather To Waiting.
CompileMarkSeparation
XProfan 9 (lokaler Bereich, Operatoren)
Autor: Michael Wodrich
Def InRange(3)   If((@&(1) >= @&(2)) and (@&(1) <= @&(3)),1,0)
Def InRangeEx(3) If((@&(1) >  @&(2)) and (@&(1) <  @&(3)),1,0)
Die aus Mail-Programmen bekannte ROT13-Verschlüsselung.
Zweimalige Anwendung entschlüsselt den Text wieder.

Proc Rot13$

    Parameters Text$
    Declare Erg$,Buf#,Anz%,c%
    Let Anz% = Len(Text$)  Länge wird mehrmals benötigt
    Dim Buf#,Anz% + 1
    String Buf#,0 = Text$

    WhileLoop 0,Anz%

        Let c% = Byte(Buf#,&loop)

        If InRange(c%,65,77) or InRange(c%,97,109)  A..M, a..m

            Byte Buf#,&loop = c% + 13

        ElseIf InRange(c%,78,90) or InRange(c%,110,122)  N..Z, n..z

            Byte Buf#,&loop = c% - 13

        EndIf

    EndWhile

    Let Erg$ = String$(Buf#,0)
    Dispose Buf#
    Return Erg$

EndProc

cls
print ""
print Rot13$("Qvrf vfg rva Grfg.")
print ""
print Rot13$("Qvr nhf Znvy-Cebtenzzra orxnaagr EBG13-Irefpuyüffryhat.")
print Rot13$("Mjrvznyvtr Najraqhat ragfpuyüffryg qra Grkg jvrqre.")
print ""
print Rot13$("Ahe mhz rvasnpura ireoretra. Nyf Irefpuyüffryhat hatrrvtarg!")
WaitKey
end

Best wishes
Michael Wodrich
 
Programmieren, das spannendste Detektivspiel der Welt.
09/19/05  
 




Michael
W.
the goes naturally something kompakter...

there have I The logischen And and Or uses.
And: &&
Or: ||

leaves itself means too on The 11it Version adjust.
// Author: Michael Wodrich

Proc ruddy13

    Parameters string s
    Declare string res, int c

    WhileLoop 1,Len(s)

        // c = ord(mid$(s,&loop,1))
        c = ord(substr$(s,&loop))
        res = res + Chr$(if(((c >  64) && (c <  78)) || ((c >  96) && (c < 110)), c + 13, if(((c >  77) && (c <  91)) || ((c > 109) && (c < 123)), c - 13, c )))

    EndWhile

    Return res

ENDPROC

cls
Declare x$
x$ = "Test abc,123"
Print "    Original:",x$
x$ = ruddy13(x$)
Print "encode ruddy13:",x$
x$ = ruddy13(x$)
Print "decode ruddy13:",x$
print ""
print ruddy13("Qvrf vfg rva Grfg.")
print ""
print ruddy13("Qvr nhf Znvy-Cebtenzzra orxnaagr EBG13-Irefpuyüffryhat.")
print ruddy13("Mjrvznyvtr Najraqhat ragfpuyüffryg qra Grkg jvrqre.")
print ""
print ruddy13("Ahe mhz rvasnpura ireoretra. Nyf Irefpuyüffryhat hatrrvtarg!")
WaitKey
end
 
Alle Sprachen
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
10/27/20  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.604 Views

Untitledvor 0 min.
H.Brill07/30/24
Walter06/11/23
Tommy08/08/21
Stephan Sonneborn07/07/21
More...

Themeninformationen

this Topic has 2 subscriber:

Michael W. (1x)
Michael Wodrich (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie