How can one obfuscate the structure of an encrypted folder while maintaining the original directory structure?

I am currently working on a form of backup software that supports encryption but also maintains the directory structure of the encrypted files and folders so that it is also decryptable and easily accessible on mobile. The problem that arises is that doing so would result in being able to approximate the directory structure of the encrypted directories.

I do not want to use “encrypted” containers that split themselves because that would require all content to me migrated to the container and that would be a nuisance for the average end user.

I have thought about two potential solutions for attempting to hide the directory structure of the encrypted folders, one would be to create “dummy” directories and files that would contain random information and would have a unique identifier determined by a PRNG whose seeding is done by the Argon2d hash of the secret such that it can be illustrated as such:

{   "filename_secret": "t983q4hyt8q90h23jt49g8q32yht98q34h2t98432th2893t98oi34hj89th38394th54ht89025",   "filename_checksum": "98fgh34892tjh8934ht983h4tg80h350th34509yjtth54ijy",   "filename_identifier": "1250685768126012",   "filename_contents": "gtf90i8234hrt8h340t89h3480th08h435wt0843jhyhj03495hy4039iyjh9450yj90435jy0945jy09543jy09435jy90435jy9045j90yj94035jyt843h598th98tg9873gt89732gt89og3498tg79234gtbu934hgt9783g49tugbh3489tgfh34897tb9ui34ht9834ht9843ght98734b2t89erkjbgfuisdgfbvkjisdbafguoisahrguifgh8734gt873g4t7342gtb98324gt3874hgt89h5t893h2890th93428ght9u23ohnth8934gh893urgfbuoiewrbg7eguisofbv9uebnfvuiowerbfg98werhfg" } 

The identifier serves the purpose of skipping such files for resource-intensive operations since they are dummy files. The problem with this is that the identifier, if determined (say, because it is the same) will simply be a trivial problem for a potential attacker to remove the dummy files

The second option would be to remove the identifier and simply keep a list of all dummy files within the _tablefile that will be generated in each directory for the purposes of versioning support and then encrypt that as a secret and then while processing, go through the _tablefile and ignore them for all purposes.

Neither of them seem like elegant options and I cannot think of a better way to implement a way to hide directory structure while maintaining it for the user only. What would be an elegant way to succeed in doing that?

How to protect data integrity in IoT network?

The security of IoT devices is very important to protect the data uploaded by IoT devices. Because if an attacker force an IoT device to upload misleading/false data, the analytics and insights generated by IoT system would lead to corrupted information.

Therefore in order to make sure that data uploaded by IoT device is guninue and not fake which is the best technique? or in other words how to ensure that the data sent is sent by an authentic device and not the fake (hacked) device?

Radix Sort – Base converting

I have some difficulties with calculating base for computing time complexity.

Given n integers in [0…nlogn-1]. What is the time complexity in worse case scenario of the best way of sorting given n integers.

We know that radix sort time complexity is O(d(n+k)) when d is the number of digits and k is the base.

I know that if the range was [0…n^constant] it was easy to calculate since n is the base and we have k=constant+1 so the time complexity is O(n).

moreover, if the range was [0…logn^logn] with log laws I can transform it to n^loglogn then the base is n and k is loglogn so it will be O(nloglogn).

But, in case above I don’t know how to covert it to base n… (the answer it is O(n), however I don’t understand why)

May the following claims be helpful to calculate it, however even them I didn’t understand yet, so it will be appreciated if it could be explained(if the are relevant).

Given n b-bits numbers, and r ≤ b, the time complexity of Radix Sort is Θ((b/r)(n + 2^r)).

Given n b-bits numbers, the time complexity of Radix Sort is

Θ(n) if b ≤ log n and Θ(bn/log n) if b > log n.

What the correct method to perform it?

what is soln and code for this problem

given string s1 and s2, we have to transform s1 to palindrome such that s1 contain s2 as substring in minimum opeartion, where operation is we can convert any character to an other character . print -1 if not possible .

Ex. : s1 = arbcd, s2 = ar output : 2 s1 = aaaaa, s2 = bbb output : 3

“Wrong answer” for extremely small, simple problem on codechef

ATM: Problem Code: HS08TEST from codechef.

Pooja would like to withdraw X $ US from an ATM. The cash machine will only accept the transaction if X is a multiple of 5, and Pooja’s account balance has enough cash to perform the withdrawal transaction (including bank charges). For each successful withdrawal the bank charges 0.50 $ US. Calculate Pooja’s account balance after an attempted transaction.

Input:

  • Positive integer $ 0 < X \leq 2000$ – the amount of cash which Pooja wishes to withdraw.

  • Nonnegative number $ 0 \leq Y \leq 2000$ with two digits of precision – Pooja’s initial account balance.

Output:

  • Output the account balance after the attempted transaction, given as a number with two digits of precision. If there is not enough money in the account to complete the transaction, output the current bank balance.

Example – Successful Transaction

Input:

30 120.00

Output:

89.50

Example – Incorrect Withdrawal Amount (not multiple of 5)

Input:

42 120.00

Output:

120.00

My solution in C++ is:

#include <bits/stdc++.h> using namespace std; int main() {   float bal;   int w;   cin>>w>>bal;   if(w+.5> bal  || w%5!= 0)     cout<<bal<<".00";   else     cout<<fixed<<setprecision(2)<< bal-w-.5;     return 0; } 

Unhadled exception in c++ program for doubly linked list

I wrote a program for doubly linked list in visual studio 2013, and it threw unhandled exception error at the line marked with comment: –

#pragma once #include<iostream>  template <typename T> struct Node {     T data;     Node *next, *prev; };  template <typename T> class doubleLinkedList { private:     Node<T> *top; public:     doubleLinkedList()     {         top = nullptr;     }      void add(T data)     {         Node<T> *temp = new Node<T>;          temp->prev = nullptr;         temp->next = top;         top->prev = temp;     //unhandled exception here         top = temp;     }      void display()     {         Node<T> *temp;         temp = top;         std::cout<<"nullptr<--->\n";         while(temp)         {             std::cout<<temp->data<<"<--->";             temp = temp->next;         }         std::cout<<"nullptr\n";     } }; 

The error is: –

Unhandled exception at 0x011C4B79 in dataStructures2.exe: 0xC0000005: Access violation writing location 0x00000008. 

I have never written a doubly linked list before. I am not sure if there any logical error in the program. Any kind of help would be appreciated.

New user has appeared on my Macbook Pro

Today I noticed the addition of a new user “Linchengzhang” on my MacBook pro. Apparently the user was added 25th April 2019 (according to the folder creation) and it appears to have an identical structure as those described in this postand this post. I don’t know how they managed to structure their files so they could grab all the directory in a screenshot, but if anyone knows and needs to to see it, let me know.

Interestingly, they do not show up in “users and groups”, so I don’t think they’re really classed as a user, but they are placed in the “Users” subdirectory.

As it’s mentioned in the first post I’ve linked I do have to say that this mac has been sent away for repairs to Apple on 8th April 2019.

I do download a lot of software from a lot of places as I’m a bioinformatics student working on many different projects and so I can’t rule out that I’ve downloaded something suspicious. I’m curious as to the fact I haven’t noticed it until now, I spend quite a bit of time moving between directories and it’s not unusual for me to accidently wind up in the Users directory when I go one or two too far back.

It seems quite suspicious to me (as a non-information security professional) and I was wondering a) what you all think and b) what do I do about it?