由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - xor cipher面试题求解
相关主题
A家店面栽在一个老中手里热腾腾的hulu面经
贡献几道A家intern的题find first nonduplicate unicode questions
问一道题(8)Google第二轮电面
Google的面经真羡慕CS科班出身的马公的记忆力
Google Intern面经顺求bless~继续攒人品,发Apple面试题(iCloud)
顶风上来问道题:一个很大char[], 如何in-place 删除重复元素求教一道关于string的Google面试题~~
Google实习第一轮电话面试总结分享一道google 面试题。大数据相关。
G家电面被拒,请帮助分析原因请教:C++, 忽略大小写的字符串比较
相关话题的讨论汇总
话题: plaintext话题: xor话题: key话题: utility话题: block
进入JobHunting版参与讨论
1 (共1页)
y*****m
发帖数: 723
1
要求写一个xor cipher的utility。
要求摘要:“Create a utility that will perform a simple XOR cryptographic
transform on a given set of data. The encryption key will be provided by the
binary data in an arbitrarily-sized external file. The size of the key in
bytes will dictate the "block size." The plaintext data will be given on
stdin, where the utility will then break it into block-sized sections, XOR
it against the key, and write the cypher text to stdout. After each block is
processed, the key should be rotated to the left by one bit to make a new
key. This means that the key will repeat every N blocks, where N is the
number of bits in the key. The plaintext data need not be a multiple of the
block size in length, nor should it be assumed to be ASCII or Unicode text.
It is also valid for the plaintext to be extremely large, far exceeding the
available memory+swap space for the system.
In addition to correctly performing the transform, the utility should be
able to take advantage of multi-core or multi-processor machines by
implementing a multi-threading scheme that processes multiple blocks of
plaintext in parallel.“
问题:
1。如果plaintext的大小(byte)不是keyfile大小的整数倍,怎么进行xor,需要把
plaintext填充成整数倍?
2。怎么让utility能进行多线程运算?这个问题已经超过我的背景知识了。。。
要求用C、C++,各位有什么想法尽量提,谢谢。
1 (共1页)
进入JobHunting版参与讨论
相关主题
请教:C++, 忽略大小写的字符串比较Google Intern面经顺求bless~
新手问个C++(Thinking in C++ source code)顶风上来问道题:一个很大char[], 如何in-place 删除重复元素
BB campus interview 4轮面经Google实习第一轮电话面试总结
HashMap, HashTable and Array 有啥区别G家电面被拒,请帮助分析原因
A家店面栽在一个老中手里热腾腾的hulu面经
贡献几道A家intern的题find first nonduplicate unicode questions
问一道题(8)Google第二轮电面
Google的面经真羡慕CS科班出身的马公的记忆力
相关话题的讨论汇总
话题: plaintext话题: xor话题: key话题: utility话题: block