2020-07-07 13:37:23 +00:00
|
|
|
"""Onionr - Private P2P Communication.
|
2019-06-13 06:58:17 +00:00
|
|
|
|
2020-07-07 13:37:23 +00:00
|
|
|
Use the communicator to insert fake mail messages
|
|
|
|
"""
|
|
|
|
import secrets
|
|
|
|
|
|
|
|
from etc import onionrvalues
|
|
|
|
import onionrblocks
|
|
|
|
"""
|
2019-06-13 06:58:17 +00:00
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2020-07-07 13:37:23 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
2019-06-13 06:58:17 +00:00
|
|
|
def insert_deniable_block(comm_inst):
|
2020-07-07 13:37:23 +00:00
|
|
|
"""Insert a fake block to make it more difficult to track real blocks."""
|
2019-06-13 06:58:17 +00:00
|
|
|
fakePeer = ''
|
|
|
|
chance = 10
|
|
|
|
if secrets.randbelow(chance) == (chance - 1):
|
|
|
|
# This assumes on the libsodium primitives to have key-privacy
|
|
|
|
fakePeer = onionrvalues.DENIABLE_PEER_ADDRESS
|
2020-01-20 03:06:22 +00:00
|
|
|
data = secrets.token_hex(secrets.randbelow(5120) + 1)
|
2020-07-07 13:37:23 +00:00
|
|
|
onionrblocks.insert(data, header='pm', encryptType='asym',
|
|
|
|
asymPeer=fakePeer, disableForward=True,
|
|
|
|
meta={'subject': 'foo'})
|
|
|
|
comm_inst.decrementThreadCount('insert_deniable_block')
|