
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Obfuscate your message with Text Obfuscator
pip install -U textobfuscator
import random
from textobfuscator.obfuscator import TextObfuscator
# 1. Replace char.
# First, now we define rules: replace chars groups.
CHARS_GROUPS_SOURCE_MAP = (
["😯", "🤣"],
["❌", "✅"],
)
# 2. Format(Optional)
# Second, let's make some rules to fill the vars that we inserted.
FORMAT_PREFIX_RULES = {
"fake_name": lambda: random.choice(("John", "Min", "William")),
"random_weather": lambda: random.choice(("cloudy", "rainy", "sunny", "windy"))
}
obfuscator = TextObfuscator(
replace_source_map=CHARS_GROUPS_SOURCE_MAP,
format_prefix_rules=FORMAT_PREFIX_RULES,
)
Now we have an instance of TextObfuscator
: obfuscator
, let's do some obfuscations.
from textobfuscator.processor import BreakWord, ObfuscationConfig, Replace
# For each obfuscation, we may specify different rules, such as controls for different words or the number of substitutions, so we make rule here first.
BREAK_WORDS_RULES = [
# We break the word `hello` twice, and put `*` into the middle, like `h*el*lo`
BreakWord(word="hello", places=2, fill="*"),
# We break the word `world` once, and put `-` into the middle, like `wor-ld`
BreakWord(word="world", places=1, fill="-"),
]
OBFUSCATOR_CONFIG = ObfuscationConfig(
# During the entire obfuscation process, we only replace 1 times.
replaces=Replace(count=1),
break_words=BREAK_WORDS_RULES,
)
# OK, let's do the obfuscation.
>>> original1 = "hello world!"
>>> obfuscated = obfuscator.obfuscate(original1, config=OBFUSCATOR_CONFIG)
>>> print(obfuscated)
>>> h*ell*o wor-ld!
>>> original2 = "❌ hi {fake_name}, today's weather is {random_weather} 😯"
>>> obfuscated = obfuscator.obfuscate(original2, config=OBFUSCATOR_CONFIG)
>>> print(obfuscated)
>>> ❌ hi John, today's weather is windy 🤣
# Once more.
>>> obfuscated = obfuscator.obfuscate(original2, config=OBFUSCATOR_CONFIG)
>>> print(obfuscated)
>>> ✅ hi Min, today's weather is sunny 😯
pre-defined
key args and given key args.
Here pre-defined
args means we can create custom var generation rules.
For example, we can pass config like below to let all vars stars wth digit
to autofill in with a real digit, and all vars starts with letter
to autofill in with a real letter.
And the var with the same name will also be filled with the same value.
# config
# {
# "digit": lambda: random.choice(string.digits),
# "letter": lambda: random.choice(string.ascii_letters),
# }
# before
>>> "{digit1} {digit2} {letter2} {digit2}"
# after
>>> 8 6 z 6
FAQs
Text obfuscator.
We found that textobfuscator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.