Jump to content

Why is encrypted string(_StringEncrypt) almost same for every string with same PW?


 Share

Recommended Posts

I wish i can use one password to encrypt several strings but the problem is they end up almost all the same like if i encrypt

new york with password cities it will be something like 9881, washington encrypted with same pw will be something like 9882, Phoenix will be 9883 etc...

Is this really reliable way to encrypt things when people can just change one number in encrypted string and therefore get your data even if you dont want them to?

How can i encrypt strings with same password but make it that they are pretty much different so people can not guess like cities encrypted would instead be

Washington - 98CD

New York - 81X9

etc...

I tried to use deeper encrypt level but funny enough sometimes only 2 digits will change in that case no matter how deep your encrypt lvl is.

Maybe i am just paranoid but i i wish encryption would be different for each thing you encrypt while using same pw :D

Since i am using this for licensing algorythm i am working on you can see how this could cause problems like if user of program could just accidently hit another key and he would get completely different license!

Melba and others who perhaps know ways around this?

Edited by Aktonius
Link to comment
Share on other sites

  • Moderators

Aktonius,

Simple answer - do not use _StringEncrypt! :rip:

Try _Crypt_EncryptData - a lot better: :oops:

#include <crypt.au3>

Global $aCities[3] = ["New York", "Washington", "Phoenix"]

_Crypt_Startup()

$hKey = _Crypt_DeriveKey("SomePassword", $CALG_RC4)

For $i = 0 To 2
    ; Encrypt the name
    $bEncrypted = _Crypt_EncryptData($aCities[$i], $hKey, $CALG_USERKEY)
    ; And then decrypt it
    $bDecrypted = _Crypt_DecryptData($bEncrypted, $hKey, $CALG_USERKEY)
    ; And display the 2 results
    ConsoleWrite($bEncrypted & " - " & BinaryToString($bDecrypted) & @CRLF)

Next

_Crypt_DestroyKey($hKey)
_Crypt_Shutdown()

All clear? :D

M23

Edit: Typnig!

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Aktonius,

It should have read _Crypt_Startup() and it is an optional initialisation of the Crypt UDF library - I suggest you put it back in! :oops:

M23

Edit: I see you worked it out - and I have fixed the typos (stupid copy/paste error). I really do not like this new post editor at all! :D

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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...