I am trying to pipe the content of a file to a simple ASCII symmetrical encryption program i made.
(我试图将文件的内容传输到我制作的简单ASCII对称加密程序中。)
It's a simple program that reads input from STDIN and adds or subtracts a certain value (224) to each byte of the input. (这是一个简单的程序,可从STDIN读取输入,并对输入的每个字节加或减某个值(224)。)
For example: if the first byte is 4 and we want to encrypt, then it becomes 228. If it exceeds 255, the program just performs some modulo. (例如:如果第一个字节为4,而我们要加密,则它变为228。如果它超过255,则程序仅执行一些模运算。)
This is the output I get with cmd (test.txt contains "this is a test"):
(这是我通过cmd获得的输出(test.txt包含“这是测试”):)
type .est.txt | .Crypt.exe --encrypt | .Crypt.exe --decrypt
this is a test
It also works the other way, thus it is a symmetrical encryption algorithm
(它也以其他方式起作用,因此它是一种对称加密算法)
type .est.txt | .Crypt.exe --decrypt | .Crypt.exe --encrypt
this is a test
But, the behaviour on PowerShell is different.
(但是,PowerShell上的行为有所不同。)
When encrypting first, I get: (第一次加密时,我得到:)
type .est.txt | .Crypt.exe --encrypt | .Crypt.exe --decrypt
this is a test_*
And that is what I get when decrypting first:
(这就是我首先解密时得到的:)
Maybe is an encoding problem.
(也许是编码问题。)
Thanks in advance. (提前致谢。)
ask by Adel M. translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…