encryption

How to encrypt and decrypt pandas dataframe with decryption key?

拟墨画扇 提交于 2020-11-29 08:02:03
问题 I have a df with 300 columns but there is one column ID that I want to encrypt and allow anyone else with a key to decrypt if I give them the df as a csv. Is this possible? I know how to hash a column, but as far as I have read I can not unhash it or give someone a key to unhash it. Thank you in advance. edit: df id 1 2 3 @Wen is this a good example: (1:2), (2:3),(3:4) new df id 2 3 4 回答1: I'd recommend the python itsdangerous library. Here is a quick example: from itsdangerous import

arnold/book cipher with python

喜夏-厌秋 提交于 2020-11-28 09:08:00
问题 I'm trying to write a book cipher decoder, and the following is what i got so far. code = open("code.txt", "r").read() my_book = open("book.txt", "r").read() book = my_book.txt code_line = 0 while code_line < 6 : sl = code.split('\n')[code_line]+'\n' paragraph_num = sl.split(' ')[0] line_num = sl.split(' ')[1] word_num = sl.split(' ')[2] x = x+1 the loop changes the following variables: paragraph line word and every thing is working just fine . but what I need now is how to specify the

arnold/book cipher with python

我的未来我决定 提交于 2020-11-28 09:02:16
问题 I'm trying to write a book cipher decoder, and the following is what i got so far. code = open("code.txt", "r").read() my_book = open("book.txt", "r").read() book = my_book.txt code_line = 0 while code_line < 6 : sl = code.split('\n')[code_line]+'\n' paragraph_num = sl.split(' ')[0] line_num = sl.split(' ')[1] word_num = sl.split(' ')[2] x = x+1 the loop changes the following variables: paragraph line word and every thing is working just fine . but what I need now is how to specify the