Aktonius Posted December 3, 2011 Posted December 3, 2011 (edited) 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 encryptnew 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 beWashington - 98CDNew York - 81X9etc...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 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 December 3, 2011 by Aktonius
Moderators Melba23 Posted December 3, 2011 Moderators Posted December 3, 2011 (edited) Aktonius,Simple answer - do not use _StringEncrypt! Try _Crypt_EncryptData - a lot better: #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? M23Edit: Typnig! Edited December 3, 2011 by Melba23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Aktonius Posted December 3, 2011 Author Posted December 3, 2011 (edited) Thanks Melba, Works great and i like this better! edit: There are still some typos though (Crypt_Startup, _For) in case you wanna edit Edited December 3, 2011 by Aktonius
Moderators Melba23 Posted December 3, 2011 Moderators Posted December 3, 2011 (edited) 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! M23Edit: 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! Edited December 3, 2011 by Melba23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Aktonius Posted December 3, 2011 Author Posted December 3, 2011 Yep, i see now after checking the au3 help file, all good.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now