Package socialmediasteganography
Interface SocialMediaSteganography
-
- All Known Implementing Classes:
SocialMediaSteganographyImpl
public interface SocialMediaSteganography
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
decodeCarrier(MediaType mediaType, byte[] carrier)
Decodes hidden payload from carrierboolean
encodeAndPost(APINames apiNames, java.lang.String keyword, byte[] carrier, byte[] payload, MediaType mediaType)
Encodes payload in carrier and posts the result to socialMediaboolean
encodeAndPost(APINames apiNames, java.lang.String keyword, byte[] carrier, byte[] payload, MediaType mediaType, Token token)
Loads carrier from file path and uses encodeAndPostboolean
encodeAndPost(APINames apiNames, java.lang.String keyword, java.lang.String path, byte[] payload, MediaType mediaType)
Loads carrier from file path and uses encodeAndPostbyte[]
encodeCarrier(byte[] carrier, byte[] payload, MediaType mediaType)
Encodes payload into carrier for a given mediatypebyte[][]
getMediaAndDecode(java.lang.String keyword, APINames apiNames, MediaType mediaType)
Gets Media for a certain Keyword and checks if it is a steganographic picture.boolean
postToSocialMedia(byte[] carrier, APINames apiNames, java.lang.String keyword, MediaType mediaType)
Post media to Social Media, if no Token is given set Parameter beforehand e.g.boolean
postToSocialMedia(byte[] carrier, APINames apiNames, java.lang.String keyword, MediaType mediaType, Token token)
Post media to Social Mediavoid
saveEncodedPicture(byte[] carrier, byte[] payload, MediaType mediaType, java.lang.String savepath)
Save encoded Media to given path as a filevoid
saveEncodePicture(java.lang.String filepath, MediaType mediaType, byte[] payload, java.lang.String savepath)
Load Media from a file and save encoded Media to given path as a filevoid
setSeed(java.lang.Long seed)
Set the seed for decoding or encodingSocialMedia
subscribeToSocialMedia(java.lang.String keyword, APINames apiNames)
Subscribes a keyword to a social media
-
-
-
Method Detail
-
encodeAndPost
boolean encodeAndPost(APINames apiNames, java.lang.String keyword, byte[] carrier, byte[] payload, MediaType mediaType) throws UnsupportedMediaTypeException, MediaNotFoundException, MediaCapacityException, MediaReassemblingException, java.io.IOException
Encodes payload in carrier and posts the result to socialMedia- Parameters:
apiNames
- API Namecarrier
- data used to encode the payload inpayload
- payload to encodemediaType
- The type of the carrier (e.g. PNG.GIF)keyword
- The name under which the carrier is posted to social Media- Returns:
- boolean true, when carrier is successfully posted
- Throws:
UnsupportedMediaTypeException
- if the MediaType is not supportedMediaNotFoundException
- if f the intended media (e.g. Image, Video, ...) could not be read from dataMediaCapacityException
- if the payload doesn't fit in the carrierjava.io.IOException
- if there is a problem with reading Data from carrier or payloadMediaReassemblingException
- if a problem occurred during writing of the result media
-
encodeAndPost
boolean encodeAndPost(APINames apiNames, java.lang.String keyword, java.lang.String path, byte[] payload, MediaType mediaType) throws java.io.IOException, UnsupportedMediaTypeException, MediaNotFoundException, MediaReassemblingException, MediaCapacityException
Loads carrier from file path and uses encodeAndPost- Parameters:
path
- Path to a Media fileapiNames
- API Namepayload
- payload to encodemediaType
- The type of the carrier (e.g. PNG.GIF)keyword
- The name under which the carrier is posted to social Media- Returns:
- boolean true, when carrier is successfully posted
- Throws:
UnsupportedMediaTypeException
- if the MediaType is not supportedMediaNotFoundException
- if f the intended media (e.g. Image, Video, ...) could not be read from dataMediaCapacityException
- if the payload doesn't fit in the carrierjava.io.IOException
- if there is a problem with reading Data from carrier or payloadMediaReassemblingException
- if a problem occurred during writing of the result media- See Also:
encodeAndPost(APINames, String, byte[], byte[], MediaType)
-
encodeAndPost
boolean encodeAndPost(APINames apiNames, java.lang.String keyword, byte[] carrier, byte[] payload, MediaType mediaType, Token token) throws java.io.IOException, UnsupportedMediaTypeException, MediaNotFoundException, MediaReassemblingException, MediaCapacityException
Loads carrier from file path and uses encodeAndPost- Parameters:
apiNames
- API Namepayload
- payload to encodecarrier
- data used to encode the payload inmediaType
- The type of the carrier (e.g. PNG.GIF)keyword
- The name under which the carrier is posted to social Mediatoken
- Token class with tokens for Social Media- Returns:
- boolean true, when carrier is successfully posted
- Throws:
UnsupportedMediaTypeException
- if the MediaType is not supportedMediaNotFoundException
- if f the intended media (e.g. Image, Video, ...) could not be read from dataMediaCapacityException
- if the payload doesn't fit in the carrierjava.io.IOException
- if there is a problem with reading Data from carrier or payloadMediaReassemblingException
- if a problem occurred during writing of the result media- See Also:
encodeAndPost(APINames, String, byte[], byte[], MediaType)
-
saveEncodedPicture
void saveEncodedPicture(byte[] carrier, byte[] payload, MediaType mediaType, java.lang.String savepath) throws UnsupportedMediaTypeException, MediaNotFoundException, MediaCapacityException, MediaReassemblingException, java.io.IOException
Save encoded Media to given path as a file- Parameters:
carrier
- data used to encode the payload inpayload
- payload to encodemediaType
- The type of the carrier (e.g. PNG.GIF)savepath
- The path to which the generated file is saved- Throws:
UnsupportedMediaTypeException
- if the MediaType is not supportedMediaNotFoundException
- if f the intended media (e.g. Image, Video, ...) could not be read from dataMediaCapacityException
- if the payload doesn't fit in the carrierjava.io.IOException
- if there is a problem with reading Data from carrier or payloadMediaReassemblingException
- if a problem occurred during writing of the result media
-
saveEncodePicture
void saveEncodePicture(java.lang.String filepath, MediaType mediaType, byte[] payload, java.lang.String savepath) throws java.io.IOException, UnsupportedMediaTypeException, MediaNotFoundException, MediaReassemblingException, MediaCapacityException
Load Media from a file and save encoded Media to given path as a file- Parameters:
payload
- payload to encodemediaType
- The type of the carrier (e.g. PNG.GIF)savepath
- The path to which the generated file is savedfilepath
- the path to the file thath needs to be encoded- Throws:
UnsupportedMediaTypeException
- if the MediaType is not supportedMediaNotFoundException
- if f the intended media (e.g. Image, Video, ...) could not be read from dataMediaCapacityException
- if the payload doesn't fit in the carrierjava.io.IOException
- if there is a problem with reading Data from carrier or payloadMediaReassemblingException
- if a problem occurred during writing of the result media- See Also:
saveEncodedPicture(byte[], byte[], MediaType, String)
-
postToSocialMedia
boolean postToSocialMedia(byte[] carrier, APINames apiNames, java.lang.String keyword, MediaType mediaType)
Post media to Social Media, if no Token is given set Parameter beforehand e.g. Tumbler.setApiKey = "..." and Tumbler.setApiSecretKey- Parameters:
carrier
- data that should be uploadedapiNames
- API Namekeyword
- The name under which the carrier is posted to social MediamediaType
- The type of the carrier (e.g. PNG.GIF)- Returns:
- boolean true when carrier was successfully posted
-
postToSocialMedia
boolean postToSocialMedia(byte[] carrier, APINames apiNames, java.lang.String keyword, MediaType mediaType, Token token)
Post media to Social Media- Parameters:
carrier
- data that should be uploadedapiNames
- API Namekeyword
- The name under which the carrier is posted to social MediamediaType
- The type of the carrier (e.g. PNG.GIF)token
- The token used to access Social Media- Returns:
- boolean true when carrier was successfully posted
-
encodeCarrier
byte[] encodeCarrier(byte[] carrier, byte[] payload, MediaType mediaType) throws UnsupportedMediaTypeException, MediaCapacityException, MediaNotFoundException, MediaReassemblingException, java.io.IOException
Encodes payload into carrier for a given mediatype- Parameters:
carrier
- data used to encode the payload inpayload
- payload to encodemediaType
- The type of the carrier (e.g. PNG.GIF)- Returns:
- byte[] carrier with encoded payload
- Throws:
UnsupportedMediaTypeException
- if the MediaType is not supportedMediaNotFoundException
- if f the intended media (e.g. Image, Video, ...) could not be read from dataMediaCapacityException
- if the payload doesn't fit in the carrierjava.io.IOException
- if there is a problem with reading Data from carrier or payloadMediaReassemblingException
- if a problem occurred during writing of the result media
-
subscribeToSocialMedia
SocialMedia subscribeToSocialMedia(java.lang.String keyword, APINames apiNames)
Subscribes a keyword to a social media- Parameters:
keyword
- The name under which the carrier is posted to social MediaapiNames
- API Name- Returns:
- Social Media The Social Media Class that can be used for interacting with given API
-
getMediaAndDecode
byte[][] getMediaAndDecode(java.lang.String keyword, APINames apiNames, MediaType mediaType)
Gets Media for a certain Keyword and checks if it is a steganographic picture. If it is, proceeds to decode the picture and return payload- Parameters:
keyword
- keyword under which the media was postedapiNames
- name of the api usedmediaType
- media type in which the payload is decoded- Returns:
- payloads all payloads that could be read
-
decodeCarrier
byte[] decodeCarrier(MediaType mediaType, byte[] carrier) throws UnsupportedMediaTypeException, UnknownStegFormatException, MediaNotFoundException, java.io.IOException
Decodes hidden payload from carrier- Parameters:
mediaType
- The type of the carrier (e.g. PNG.GIF)carrier
- data with encoded payload- Returns:
- payload decoded payload
- Throws:
UnsupportedMediaTypeException
- if the MediaType is not supportedUnknownStegFormatException
- UnknownStegFormatExceptionjava.io.IOException
- if a problem occurs during reading of steganographicDataMediaNotFoundException
- if the intended media (e.g. Image, Video, ...) could not be read from steganographicData
-
setSeed
void setSeed(java.lang.Long seed)
Set the seed for decoding or encoding- Parameters:
seed
- The seed to initialize random function
-
-