Skip to content

Commit

Permalink
Fix LSB/MSB confusion, hotfix parameter typo bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wqyeo committed Jun 12, 2024
1 parent abb2a35 commit bd8c233
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions steganography-client/src/lib/components/bitsSelector.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
export let selectedNumbers = [0];
export let selectedNumbers = [7];
/**
*
Expand All @@ -19,7 +19,7 @@
</script>

<div class="tickboxes">
{#each Array.from({ length: 8 }, (_, i) => i).reverse() as number}
{#each Array.from({ length: 8 }, (_, i) => i) as number}
<div class="tickbox">
<input
type="checkbox"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</label>

<button type="button" disabled={disabled || isWhitespaceOrEmpty(keyToUse)} class="btn variant-filled" on:click={(event) => requestDecode(keyToUse)}>
<span>Encode!</span>
<span>Decode!</span>
</button>


Expand Down
2 changes: 1 addition & 1 deletion steganography-client/src/lib/services/decodeFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default async function decodeFile(
formData.append('g_bits', JSON.stringify(greenBits));
formData.append('b_bits', JSON.stringify(blueBits));
formData.append('secret_key', endKey);
formData.append('generator_Type', generatorType)
formData.append('generator_type', generatorType)

const options = {
method: 'POST',
Expand Down
2 changes: 1 addition & 1 deletion steganography-client/src/lib/services/encodeFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async function encodeFile(
formData.append('b_bits', JSON.stringify(blueBits));
formData.append('message', toEncode);
formData.append('secret_key', endKey);
formData.append('generator_Type', generatorType)
formData.append('generator_type', generatorType)

const options = {
method: 'POST',
Expand Down
7 changes: 4 additions & 3 deletions steganography-client/src/routes/decode-picture/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
let originalUUID = '';
let redBitsSelection = [0]
let greenBitsSelection = [0]
let blueBitsSelection = [0]
let redBitsSelection = [7]
let greenBitsSelection = [7]
let blueBitsSelection = [7]
let isDecoding = false;
Expand Down Expand Up @@ -90,6 +90,7 @@

<!--Bits Selection-->
<h3 class="h3 mt-2">Select Bits</h3>
<blockquote class="blockquote">By index; 0 is MSB, 7 is LSB</blockquote>
<ul class="list">
<li>
<span class="h6 text-error-600">Red</span>
Expand Down
7 changes: 4 additions & 3 deletions steganography-client/src/routes/encode-picture/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
*/
let encodedUUID = null;
let redBitsSelection = [0]
let greenBitsSelection = [0]
let blueBitsSelection = [0]
let redBitsSelection = [7]
let greenBitsSelection = [7]
let blueBitsSelection = [7]
let isEncoding = false;
Expand Down Expand Up @@ -127,6 +127,7 @@

<!--Bits Selection-->
<h3 class="h3 mt-2">Select Bits</h3>
<blockquote class="blockquote">By index; 0 is MSB, 7 is LSB</blockquote>
<ul class="list">
<li>
<span class="h6 text-error-600">Red</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def png_encoder_controller(image_path, secret_payload, ending_payload, r_bits_us
- r_bits_usage: Which bits to use for red during encoding
- g_bits_usage: Which bits to use for green during encoding
- b_bits_usage: Which bits to use for blue during encoding
(7 is MSB, 0 is LSB)
(7 is LSB, 0 is MSB)
- generator_type: Either 'linear', 'random' or 'fibonacci
Returns the image.
Expand Down

0 comments on commit bd8c233

Please sign in to comment.