These are chat archives for gwydirsam/DickGrayson

4th
May 2015
Martin Fracker, Jr.
@Towerism
May 04 2015 12:47
Are we meeting at 3:00 pm today? Today is technically still part of last week's sprint right? I imagine we would have a daily if we met up today in person/over skype.
Kyle Wilson
@bluyam
May 04 2015 18:39
I think that's a good idea.
Kyle Wilson
@bluyam
May 04 2015 18:50
Also Marty, it's probably something I'm doing, but your embedder/extractor seems to seg fault in cases where the input and output bmp/wav files are duplicates.
Specifically, embed_and_save()
Kyle Wilson
@bluyam
May 04 2015 19:01
(not extractor, just embedder)
Kyle Wilson
@bluyam
May 04 2015 19:16
Wait, when you run an embedding agent for the first time, should the outfile not exist yet?
Never mind, I figured out what I was doing wrong.
:)
Kyle Wilson
@bluyam
May 04 2015 19:51
Ok my scrambler is working for wav files, but it's telling me the random string is too long for the bmp. are you sure that bpp*num of pixels/8 is the right way to calculate C?
Kyle Wilson
@bluyam
May 04 2015 20:07
Because this is my only test that doesn't pass:
stego-attack-test.cc
TEST(LSBScrambler, standardBMPCase) {
 std::string file = "../../test/stego-crypt/test-stego.bmp";
 std::string message = scrambleLSB(file);
 std::unique_ptr<Abstract_extracting_agent> extractor;
 extractor = which_extracting_agent(file);
 std::string extracted = extractor->extract();
 EXPECT_EQ(message, extracted);  
}
This message was deleted
This message was deleted
stego-attack-lib.cc
std::string scrambleLSB(std::string file) {
  // Catch exceptions and throw error
  // Inaccessable_file_exception
  // Invalid_format_exception
  int length = 0; 
  if (file_type_of(file) == File_type::WAV) {
    dgwav origWAV(file);
    length = origWAV.get_num_samples() / 8;
    std::cout << length << std::endl;
  }
  else if (file_type_of(file) == File_type::BMP) {
    dgbmp origBMP(file);
    length = (origBMP.get_num_pixels() * origBMP.get_bpp()) / 8;
    std::cout << length << std::endl;
  }
  else return "";
  std::cout << "Line 101" << std::endl;
  char temp[length];
  for (int i = 0; i < length; i++) {
    temp[i] = 1; // + rand() / (RAND_MAX / 255); // from 1-254 (not including null)
  }
  std::cout << "Line 106" << std::endl;
  temp[length] = 0;
  std::cout << "Line 108" << std::endl;
  std::string randomChars = temp;
  std::cout << "Line 110" << std::endl;
  std::unique_ptr<Abstract_embedding_agent> embedder;
  embedder = which_embedding_agent(file, file);
  embedder->embed_and_save(randomChars);
  return randomChars;
}
error message:
Kyle Wilson
@bluyam
May 04 2015 20:12
[----------] 2 tests from LSBScrambler
[ RUN      ] LSBScrambler.standardBMPCase
262144
Line 101
Line 106
Line 108
Line 110
Media capacity: 262144
unknown file: Failure
C++ exception with description "Munchkin-steg: Msg_too_long_for_media_exception" thrown in the test body.
[  FAILED  ] LSBScrambler.standardBMPCase (75 ms)
I had check_msg_media_capacity()output the value it calculated and it matches mine, so I'm not sure what's wrong. When I made the length 10 times smaller (just out of curiosity) the test succeeded
Martin Fracker, Jr.
@Towerism
May 04 2015 20:23
What happens if you subtract 1?
Kyle Wilson
@bluyam
May 04 2015 20:26
I tried that
I just got it to work though
apparently I needed to divide by 8 again
does that make sense
and that's C; bpp*pixels/64+1 fails
but bbp*pixels/64 succeeds
which happens to be the same as leaving bpp out of the formula
pixels/8
This message was deleted
Kyle Wilson
@bluyam
May 04 2015 20:42
Ok now I'm confused: bpp*pixels/64 works but pixels/8 doesn't even though bpp is always printing out as 8
Kyle Wilson
@bluyam
May 04 2015 21:00
I'm just gonna roll with it ¯_(ツ)_/¯
Kyle Wilson
@bluyam
May 04 2015 21:40
This message was deleted
This message was deleted
Kyle Wilson
@bluyam
May 04 2015 23:56
Done AF. Maybe some refactoring and exception catching tomorrow, but mostly writing the report.