New minor release (v0.6.5).

This commit is contained in:
Cédric Bonhomme 2017-02-16 10:18:43 +01:00
parent f8f0ba22aa
commit 2011f197cd
No known key found for this signature in database
GPG key ID: A1CB94DE57B7A70D
5 changed files with 40 additions and 15 deletions

View file

@ -1,6 +1,13 @@
Release History
===============
0.6.5 (2017-02-16)
------------------
* added a command to list all available generators for the lsb-set module;
* test when the data image is coming via byte stream, for the lsb module.
0.6.4 (2017-02-06)
------------------

View file

@ -70,20 +70,25 @@ parser_reveal.add_argument("-o", dest="secret_binary",
help="Output for the binary secret (Text or any binary file).")
# Subparser: List generators
parser_list_generators = subparsers.add_parser('list-generators',
help='list-generators help')
arguments = parser.parse_args()
try:
arguments.generator_function
except AttributeError:
print('You must specify the name of a generator.')
parser.print_help()
exit(1)
if arguments.command != 'list-generators':
try:
arguments.generator_function
except AttributeError:
print('You must specify the name of a generator.')
parser.print_help()
exit(1)
try:
generator = getattr(generators, arguments.generator_function)()
except AttributeError as e:
print("Unknown generator: {}".format(arguments.generator_function))
exit(1)
try:
generator = getattr(generators, arguments.generator_function)()
except AttributeError as e:
print("Unknown generator: {}".format(arguments.generator_function))
exit(1)
if arguments.command == 'hide':
if arguments.secret_message != None:
@ -110,3 +115,9 @@ elif arguments.command == 'reveal':
f.write(data)
else:
print(secret)
elif arguments.command == 'list-generators':
import inspect
all_generators = inspect.getmembers(generators, inspect.isfunction)
for generator in all_generators:
print(generator[0], generator[1].__doc__)

View file

@ -50,7 +50,7 @@ copyright = u'2012-2017, Cédric Bonhomme'
# The short X.Y version.
version = '0.6'
# The full version, including alpha/beta/rc tags.
release = '0.6.4'
release = '0.6.5'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View file

@ -36,7 +36,7 @@ with open('CHANGELOG.rst', 'r') as f:
setup(
name='Stegano',
version='0.6.4',
version='0.6.5',
author='Cédric Bonhomme',
author_email='cedric@cedricbonhomme.org',
packages=packages,
@ -44,7 +44,7 @@ setup(
scripts=scripts,
url='https://github.com/cedricbonhomme/Stegano',
description='A Python Steganography module.',
long_description=readme + '\n\n' + changelog,
long_description=readme + '\n|\n|\n|\n' + changelog,
platforms = ['Linux'],
license='GPLv3',
install_requires=requires,

View file

@ -38,6 +38,9 @@ def identity():
n += 1
def Dead_Man_Walking():
"""
Dead Man Walking.
"""
n = 0
while True:
yield n + 7
@ -96,6 +99,10 @@ def eratosthenes_composite():
p1 = p2
def carmichael():
"""
https://oeis.org/A002997
Composite numbers n such that a^(n-1) == 1 (mod n) for every a coprime to n.
"""
for m in eratosthenes_composite():
for a in range(2, m):
if pow(a,m,m) != a:
@ -116,9 +123,9 @@ def ackermann(m, n):
def fibonacci():
"""
https://oeis.org/A000045
A generator for Fibonacci numbers, goes to next number in series on each call.
This generator start at 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, ...
See: http://oeis.org/A000045
"""
a, b = 1, 2
while True: