1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

problem with @YENCODE

Discussion in 'Support' started by Frank, Aug 1, 2012.

  1. Frank

    Joined:
    Aug 2, 2011
    Messages:
    258
    Likes Received:
    4
    I want to see what @yencode is doing, but it doesn't work for me.
    What am I doing wrong?
    Code:
    F:\Temp >ver /r
    
    TCC  14.00.30 x64   Windows 7 [Version 6.1.7601]
    TCC Build 30   Windows 7 Build 7601  Service Pack 1
    Registered to ...
     
    F:\Temp >echo %@hexENcode[s,Password]
    50617373776f7264
    
    F:\Temp >echo %@hexDEcode[s,50617373776f7264]
    Password
    
    F:\Temp >echo %@yencode[s,50617373776f7264]
    TCC: No closing quote
    
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    Verified. Platform:
    TCC 14.00.30 Windows XP [Version 5.1.2600]
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,732
    Likes Received:
    81
    WAD -- what you're doing wrong is using ECHO to display the output.

    @YENCODE is returning this result:

    =ybegin line=128 size=16_Z`[a]a]aa`a\`^=yend size=16 crc32=aa2aedda

    That is passed as an argument to ECHO, the parser sees that there is a mismatch on the number of backquotes in the line, and it displays the "no closing quote" error message.
     
  4. Frank

    Joined:
    Aug 2, 2011
    Messages:
    258
    Likes Received:
    4
    Ok, that's evident.
    But what can I do with this function at all, if the result string is so unhandily?
    The only method I can imagine is a "here redirection".
     
  5. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,732
    Likes Received:
    81
    I can't imagine why you would ever want to use @YENCODE to echo something to the display. Normally you would write the output to a file; if you need to put it in a string/environment variable you would normally assign it and then use that variable directly. If you feel compelled to write dubious output to the display, use the SAFECHARS plugin.
     
  6. Frank

    Joined:
    Aug 2, 2011
    Messages:
    258
    Likes Received:
    4
    I had the vision to obfuscate passwords with it (my colleague allways says "if you have visions, got to a doctor" :)) .
    And I thought I can try back and forth like with @hex en/de code.
    Never mind.
     
  7. Stefano Piccardi

    Joined:
    May 31, 2008
    Messages:
    376
    Likes Received:
    2
    Example with the SAFECHARS plugin (below * stands for a safe-encoded character)
    Code:
    C:\temp>echo %@SAFEEXP[@yencode[s,50617373776f7264]]
    =ybegin line=128 size=16
    _Z**a*a*aa*a\**
    =yend size=16 crc32=aa2aedda
     
    C:\temp>SAFEECHO %@SAFEEXP[@yencode[s,50617373776f7264]] >uuu
     
    C:\temp>type uuu
    =ybegin line=128 size=16
    _Z`[a]a]aa`a\`^
    =yend size=16 crc32=aa2aedda
    
     
  8. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,280
    Likes Received:
    38
    If you just want to obfuscate text, I have a couple of functions in TextUtils which should be easier to use. (The output character set was specifically chosen to avoid quotes, graves, percent signs, carets, and so on.)

    http://prospero.unm.edu/plugins/textutils.html#f_obscure
     
  9. Frank

    Joined:
    Aug 2, 2011
    Messages:
    258
    Likes Received:
    4
    cool, thank you.
     

Share This Page