Jump to content

Atbash decryption/encryption udf


Nuffilein805
 Share

Recommended Posts

here's 1 more decrypt/encyrpt mode

THIS 1 IS NOT SAFE!

if you want to use it, do it on your own risk!

;atbash
$a = InputBox ("Test", "Input Text")
$b = atbash($a)
msgbox (0, $a, $b)

func atbash($text)
    $letters = StringSplit(stringreplace($text, " ", ""), "")
    $max = $letters[0] + 1
    dim $convert[$max]
    dim $output[$max]
    $atbash = ""
    For $i = 1 To $letters[0] step 1
        $convert[$i] = asc ($letters[$i])
        if $convert[$i] > 64 and $convert[$i] < 91 Then
            $output[$i] = 91 - $convert[$i] + 64
        ElseIf $convert[$i] > 96 and $convert[$i] < 123 Then
            $output[$i] = 123 - $convert[$i] + 96
        Else
            $output[$i] = $convert[$i]
        EndIf
        $output[$i] = chr($output[$i])
        $atbash = $atbash & $output[$i]
    Next
    return $atbash
EndFunc

as usual with a little demo first

some feedback would be nice

atbash.au3

Edited by Nuffilein805
Link to comment
Share on other sites

Nuffilein805, I respect your attempt to write an "encryption" UDF and I really don't want to embarrass you!

However, you asked for feedback, so here we go ....

NEVER EVER try to build your own encryption algorithm, except you are a well educated cryptographer with at least one PhD in math or computer science and at least ten years of experience in the design of crypto-systems. Your algorithm is a very simple shift and replace operation, which can be broken like nothing by doing a simple frequency analysis (see here: http://www.cryptool.org/). So, better use well known algorithms like RC4, 3DES or AES AND implement them in the right way. That's the only way to go with encryption. If you're interested in cryptography, read the following two articles:

Why Cryptography Is Harder Than It Looks

Security Pitfalls in Cryptography

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

this is not my own encryption

i just read the theory of this simple encryption and scripted it

i know it's nothing special, but i wanted to give it a try

actually this is the simplest 1 i made, cause it only inverts the alphabet

O.K. then you should mark ist as such. If another, less experienced, user sees your code he/she might think. Cool, encryption made easy, even I can understand the code. Let's use it for my project, not knowing the algorithm is not safe at all. This could cause those people problems.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

ok your right, i'm going to mark all my encryption-things as not safe

That's not the point!

You could mark it as "experimental implementation of an ancient algorithm", just for the purpose to train your own scripting skills. Not to be used in real applications, as the algorithm is, by design, not secure.

well, which encryption is safe anyway?

None, especially if well know algorithms are implemented in the wrong way. Acutally there is no 100% security and the current advances in crypto analysis are kind of threatning for the whole security business, although nobody has found an easy way to crack any decent crypto algorithm yet.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

well i just did some more cryptoalgorithm as well like

rot_128/rot_13

vigniere

its funny to use those old 1s because at some site they are still used

try these topics:

http://www.autoitscript.com/forum/index.php?showtopic=17307

http://www.autoitscript.com/forum/index.php?showtopic=17304

i'm just trying to do caesar which is said to be the simplest but i just hit some problem there, maybe i'll get it later on

is it possible the "_stringencrypt" works just like "vigniere"?

Link to comment
Share on other sites

well i just did some more cryptoalgorithm as well like

rot_128/rot_13

vigniere

its funny to use those old 1s because at some site they are still used

Yes, cryptography is an interesting playground. You should read this book: Applied Crpytography by Bruce Schneier. http://www.schneier.com/books.html

I have seen them. BTW: ROT256 is not encryption, just encoding. The difference: With encryption, you use a key (also with simple shift and replace algorithms), even if it's implied in the code/algorithm. When you encode a string you don't use a key.

is it possible the "_stringencrypt" works just like "vigniere"?

Well, the developer says: "RC4 Based string encryption". I have not checked if it's really RC4.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Yes, cryptography is an interesting playground. You should read this book: Applied Crpytography by Bruce Schneier. http://www.schneier.com/books.html

I have seen them. BTW: ROT256 is not encryption, just encoding. The difference: With encryption, you use a key (also with simple shift and replace algorithms), even if it's implied in the code/algorithm. When you encode a string you don't use a key.

Well, the developer says: "RC4 Based string encryption". I have not checked if it's really RC4.

Cheers

Kurt

It's based on RC4 but it isn't true RC4 if memory serves me (I didn't write it). I wrote an almost true RC4 version and posted it. Now that AutoIt supports binary data-types I need to revise the code to support true RC4 since I can handle the null character correctly.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...