English
Entrance

Error with password/pwd$/encode64/decode64

 
- Page 1 -



Walter
Hello!
have my love hardship with the Ver- and decrypt through password, pwd$, encode64 and decode64.
it comes thereby not always the out, I einfülle...
make a long story short: it come into being occasionally incorrect letters.
whether the of pwd$ comes or of en-/decode, can I unfortunately not discern. be already glad, my code on one funktionierendes example vaporize to.
here my code, the in the 1. messagebox already 2 Error in the Ver-/Entschlüsseln through password 1 shows (Hälxte instead of Hälfte; on), in the 2. messagebox, through password 0 a weitern (s}hwieriger instead of tougher).
' Error with password/pwd$/encode64/decode64
declare orig$,enc$,dec$
'Testsatz
orig$= "Zum Test the Verschlüsselung needed one plenty patience! The Half the effort is circa. to Einstimmung on the second are here already 2 Error To see (Half and on). too with password 0 there Error, but yet tougher To reproduzieren!"
' part 1: with password 1
password 1,"wAs You hEUTE get, geHört DIiR aUch morGEn yet!"
'Testsatz code and again decode
enc$=__iniencode(orig$)
dec$=__inidecode(enc$)
messagebox("Teil 1 - with password 1\n\nOriginalsatz:\n"+orig$+"\n\nVer- and entschlüsselt:\n"+ dec$,"",0)
' Part 2: with password 0
password 0,"wAs You hEUTE get, geHört DIiR aUch morGEn yet!"
'Testsatz code and again decode
enc$=__iniencode(orig$)
dec$=__inidecode(enc$)
messagebox("Teil 2 - with password 0\n\nOriginalsatz:\n"+orig$+"\n\nVer- and entschlüsselt:\n"+ dec$,"",0)

proc __iniEncode

    parameters string s
    declare a$
    a$=pwd$(s)
    a$=translate $(a$,"=","#")
    a$=encode64(a$)
    return a$

endproc

proc __iniDecode

    parameters string s
    declare d$
    d$=decode64(s)
    d$=translate $(d$,"#","=")
    d$=pwd$(d$)
    return d$

endproc

 
11/03/19  
 



« this Posting watts as Solution marked. »


Georg
Teles
good tommorrow,

you have a small fallacy in the Order the Kodierung:

with Encode must Translate After the encode64 stand.
at that Decode must Translate VOR the decode64 stand.

here your code korrigiert:
' Error with password/pwd$/encode64/decode64
declare orig$,enc$,dec$
'Testsatz
orig$= "Zum Test the Verschlüsselung needed one plenty patience! The Half the effort is circa. to Einstimmung on the second are here already 2 Error To see (Half and on). too with password 0 there Error, but yet tougher To reproduzieren!"
' part 1: with password 1
password 1,"wAs You hEUTE get, geHört DIiR aUch morGEn yet!"
'Testsatz code and again decode
enc$=__iniencode(orig$)
dec$=__inidecode(enc$)
messagebox("Teil 1 - with password 1\n\nOriginalsatz:\n"+orig$+"\n\nVer- and entschlüsselt:\n"+ dec$,"",0)
' Part 2: with password 0
password 0,"wAs You hEUTE get, geHört DIiR aUch morGEn yet!"
'Testsatz code and again decode
enc$=__iniencode(orig$)
dec$=__inidecode(enc$)
messagebox("Teil 2 - with password 0\n\nOriginalsatz:\n"+orig$+"\n\nVer- and entschlüsselt:\n"+ dec$,"",0)

proc __iniEncode

    parameters string s
    declare a$
    a$=pwd$(s)
    a$=encode64(a$)
    a$=translate $(a$,"=","#")
    return a$

endproc

proc __iniDecode

    parameters string s
    declare d$
    d$=translate $(s,"#","=")
    d$=decode64(d$)
    d$=pwd$(d$)
    return d$

endproc


Nu might everything correctly. Translated go

Regards
 
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

11/10/19  
 




E.T.
If one a$=translate$(a$,"=","#")  or. d$=translate$(d$,"=","#")  auskommentiert, works
 
XProfan X3
Grüße aus Sachsen... Mario
WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte...
11/03/19  
 




E.T.
Ah Yes, from the Help Pwd$(s)  :


...
It can however vorkommen, that in the string by the conversion not druckbare Sonderzeichen come into being (How z.B,. the Zeilenende-characters), so a Use this Strings in INI-Files or Text files not recommendable is. In binären Files can it free from problems stored go.
...


i think, You change with the translate  this (binary-) String derartig, the then simply already at decode64  incorrect characters come into being, which then encode64  already correctly. "übersetzt", though already "falsch gefüttert" becomes.

two Listviews the translate at all effect ??
Erschließt itself me now not so right...

Have something like already time made:
with pwd$  verschlüsselt, with decode64  again "verwurstelt" and schreibbar for a .ini made, and the whole then tidy in a .INI-File stored. never Problems had at "zuückverwursteln"
 
Grüße aus Sachsen... Mario
WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte...
11/04/19  
 




Walter
"nicht druckbare Sonderzeichen" - therefore goes it Yes.
the concept stammt not of me, separate of here: [...] 
so far I understood have, should the translate$ the encode-end-characters "=", the through pwd$ come into being could, into harmloses characters translate, there otherwise encode abbricht.
and hereafter again back.
thanks anyway!
I probier hold now times without translate$, whether it with my "normalen Texten" functions. is hold always ungewiss, whether then sometime still a "böse" Konstellation appears...
 
11/04/19  
 




Georg
Teles
good tommorrow,

you have a small fallacy in the Order the Kodierung:

with Encode must Translate After the encode64 stand.
at that Decode must Translate VOR the decode64 stand.

here your code korrigiert:
' Error with password/pwd$/encode64/decode64
declare orig$,enc$,dec$
'Testsatz
orig$= "Zum Test the Verschlüsselung needed one plenty patience! The Half the effort is circa. to Einstimmung on the second are here already 2 Error To see (Half and on). too with password 0 there Error, but yet tougher To reproduzieren!"
' part 1: with password 1
password 1,"wAs You hEUTE get, geHört DIiR aUch morGEn yet!"
'Testsatz code and again decode
enc$=__iniencode(orig$)
dec$=__inidecode(enc$)
messagebox("Teil 1 - with password 1\n\nOriginalsatz:\n"+orig$+"\n\nVer- and entschlüsselt:\n"+ dec$,"",0)
' Part 2: with password 0
password 0,"wAs You hEUTE get, geHört DIiR aUch morGEn yet!"
'Testsatz code and again decode
enc$=__iniencode(orig$)
dec$=__inidecode(enc$)
messagebox("Teil 2 - with password 0\n\nOriginalsatz:\n"+orig$+"\n\nVer- and entschlüsselt:\n"+ dec$,"",0)

proc __iniEncode

    parameters string s
    declare a$
    a$=pwd$(s)
    a$=encode64(a$)
    a$=translate $(a$,"=","#")
    return a$

endproc

proc __iniDecode

    parameters string s
    declare d$
    d$=translate $(s,"#","=")
    d$=decode64(d$)
    d$=pwd$(d$)
    return d$

endproc


Nu might everything correctly. Translated go

Regards
 
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

11/10/19  
 




Walter
Yes, there Have I wrong consider.

with encode standing in the Help:
any values go in maximum 64 characters displayed:
A - Z, a - z, 0 - 9 and + as well as /. as Endekennzeichen serves the =.

the translate$ is evident moreover there, that the = as Endezeichen of encode not the = between Eintragsschlüssel and Sign in the INI kollidiert.

fit! Vielen Thanks!
 
11/10/19  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

6.236 Views

Untitledvor 0 min.
Uwe Starke11/17/23
Walter01/04/23
p.specht06/04/21
N.Art11/18/20
More...

Themeninformationen

this Topic has 3 subscriber:

Walter (3x)
E.T. (2x)
Georg Teles (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