---
# System prepended metadata

title: Untitled

---

## PW crack 4
```python
decryption = str_xor(flag_enc.decode(), user_pw)
```
![](https://i.imgur.com/rCEY9w0.png)

```shell
101010    (明文)
010111    （PW)
-------------(xor)
111101    (密文)
```

```shell   
111101    （密文）
010111    （PW）
-------------
101010    （明文）    

```

### 方法一：
暴力找 user_pw

### 方法二：
~~逆向找 hash~~
直接找出 correct_pw_hash


### 方法三:
不修改 python  原始碼




## PW crack 5

```python
with open('dictionary.txt') as f:
    lines = f.read().splitlines()
print(lines)

for i in range(65536):
    user_pw = lines[i]
    user_pw_hash = hash_pw(user_pw)

    if( user_pw_hash == correct_pw_hash ):
        print("Welcome back... your flag, user:")
        decryption = str_xor(flag_enc.decode(), user_pw)
        print(user_pw," ",decryption)

```

