zindosteg 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01ac48210a386fca7fec50d18a609ced3f2122f0087f1fc6ead5a14970e89968
4
- data.tar.gz: 4d11432c88bb155006a58f9f9dda92d292afb7dd5a4b671cf086b5a54467cc69
3
+ metadata.gz: da3d49d90deedb647630359804b4e4084cffd09aafd7303ff2a665d4fe8362af
4
+ data.tar.gz: 9d3a191d8902d02b76a01fb71305d2775182dfde70442ba0587205426e193b17
5
5
  SHA512:
6
- metadata.gz: '06884588dc026719a0e8f86774075432e18a459f7aa586677499bfcce31d5664705e1d06eeab09f52ddf4f8126a50e15fc26acda500c852309d7532ae87285d9'
7
- data.tar.gz: c860ce6d6f4c160fcf6d5b02066b661777fd41abde8189b5affc9a0b8eef3785e8a608f1a09079001ce3d94d2bb20d346ab92557d7836ca25cd3d66003b4ba24
6
+ metadata.gz: 3466eb92d860d7313d91ed171c79ee4054c2a96ed3aef6eaa00948516ebfb77ddd3d517c322284f347c4f64d8e134e52d8cad5a51b7272d98c97adc378c34768
7
+ data.tar.gz: 6babf9e1c764d6d6d67a49be513818f156031360cafb85e6397f6fb2f8391c11097d76c11358e2f72570e8dd1cd8a6eb7452acb2e52dfed807b462996420d906
data/README.md CHANGED
@@ -13,6 +13,7 @@ This gem is a Ruby interface to the Zindosteg C++ library, which uses a variant
13
13
  Zindosteg supports JPEG, PNG, and BMP carrier files. PNG files must have at least 8 bit depth, and not be "palette" type. BMP files must be 24-bit.
14
14
 
15
15
  ## Installation
16
+ Note: To compile the native extensions, you may need to install JPEG, PNG, and OpenSSL development packages.
16
17
 
17
18
  Add this line to your application's Gemfile:
18
19
 
@@ -28,13 +29,11 @@ Or install it yourself as:
28
29
 
29
30
  $ gem install zindosteg
30
31
 
31
- Note: To compile the native extensions, you may need to install JPEG, PNG, and OpenSSL development packages.
32
-
33
32
  ## Usage
34
33
  Zindosteg is designed to mimic Ruby's `File` class as closely as possible. The basic idea is that you get a `Zindosteg` instance by "opening" the carrier file with a password. Then you can read and write to the `Zindosteg` object in the same way you normally would to a `File` object, using the same methods (e.g. `read`, `write`, `readlines`, `eof?`, `seek`, `tell`, etc.). You can even pass the `Zindosteg` instance to functions that expect `File` objects and everything should work.
35
34
 
36
35
  ### Examples
37
- ```
36
+ ```ruby
38
37
  # Open a new carrier for writing (overwriting any existing payload)
39
38
  file = ::Zindosteg::File.open("carrier.jpeg", "secretpassword", "w")
40
39
 
@@ -63,7 +62,7 @@ file.size
63
62
  file.eof?
64
63
  # etc
65
64
 
66
- # Use the `capacity` method to see the maximum number of bytes that the carrier file can hide.
65
+ # Use the 'capacity' method to see the maximum number of bytes that the carrier file can hide.
67
66
  file.capacity
68
67
 
69
68
  # All the standard modes for opening files are supported:
@@ -73,8 +72,18 @@ file = ::Zindosteg::File.open("carrier.jpeg", "secretpassword", "a") # Opens for
73
72
 
74
73
  # etc
75
74
 
76
- # If you open for reading (or appending) and either (1) an incorrect password is given, or (2) there is no existing payload, or (3) the carrier file has been corrupted or tampered with, then a exception will be thrown.
75
+ # If you open for reading (or appending) and either
76
+ # (1) an incorrect password is given, or
77
+ # (2) there is no existing payload, or
78
+ # (3) the carrier file has been corrupted or tampered with
79
+ # then a "RuntimeError (HMAC verification failure.)" exception will be thrown.
80
+
81
+ # Shortcuts
82
+ # Insert a payload file into a carrier file in one line:
83
+ ::Zindosteg.insert(carrier_path, password, payload_path)
77
84
 
85
+ # Extract a payload from a carrier in one line:
86
+ ::Zindosteg.extract(carrier_path, password, payload_path)
78
87
  ```
79
88
 
80
89
  ## Development
@@ -661,9 +661,10 @@ namespace {
661
661
  extern "C" void Init_zindosteg()
662
662
  {
663
663
  Module rb_cModule = define_module("Zindosteg");
664
+ register_handler<rubyError>(handle_ruby_error);
665
+
664
666
  Data_Type<device_interface> rb_cZindosteg =
665
667
  define_class_under<device_interface>(rb_cModule, "File")
666
- .add_handler<rubyError>(handle_ruby_error)
667
668
  .define_constructor(Constructor<device_interface, std::string, std::string, std::string>(), Arg("carrier"), Arg("password"), Arg("mode") = "r"s)
668
669
  .define_method("<<", &device_interface::write)
669
670
  .define_method("autoclose?", &device_interface::autoclose)
@@ -1,3 +1,3 @@
1
1
  module Zindosteg
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/zindosteg.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.email = ["nephi.allred@gmail.com"]
8
8
 
9
9
  spec.summary = %q{Basic steganography}
10
- spec.description = %q{Hide and encrypt data inside JPG, PNG, and BMP files.}
10
+ spec.description = %q{Use steganography to hide and encrypt data inside JPG, PNG, and BMP files.}
11
11
  spec.homepage = "https://github.com/zindorsky/zindosteg-ruby"
12
12
  spec.license = "MIT"
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zindosteg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nephi Allred
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-22 00:00:00.000000000 Z
11
+ date: 2023-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '4.0'
41
- description: Hide and encrypt data inside JPG, PNG, and BMP files.
41
+ description: Use steganography to hide and encrypt data inside JPG, PNG, and BMP files.
42
42
  email:
43
43
  - nephi.allred@gmail.com
44
44
  executables: []
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
- rubygems_version: 3.1.6
104
+ rubygems_version: 3.4.10
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Basic steganography