Additive Secret Sharing and Share Proactivization ñ Using Python

Farhan Muhamed
Updated on 11-Jul-2025 18:24:17

589 Views

Additive Secret Sharing and Share Proactivization are cryptographic techniques to share a password or other confidential data among a group of people. In this article, we will explain these techniques and implement Python code to demonstrate them. Additive Secret Sharing Additive secret sharing is a technique used in cryptography to share a secret string or a password among multiple parties, such that all of the parties must collaborate to reconstruct the secret. For example: Original Secret Key: 1234 Generated five Shares: [-488, -55, -417, -720, 2914] Reconstructed Secret: 1234 Explanation: The original secret password is split into 5 ... Read More

Adding values to a Dictionary of List using Python

Priya Sharma
Updated on 11-Jul-2025 18:23:15

3K+ Views

Python dictionaries are built-in data structures used to store data in key-value pairs. A dictionary of lists refers to a dictionary that contains one or more lists as values for any keys. For example, # Dictionary of Lists in Python: dict = { "list1" : [1, 2, 3], "list2" : [4, 5, 6] } You are given a Python dictionary that contains empty lists, your task is to add values to the lists of dictionaries. Consider the following input output scenario: Input: { 'List1': [], 'List2': [] } Output: { 'List1': [1, 2, 3], 'List2': [4, 5, ... Read More

_Noreturn function specifier in C

Ravi Ranjan
Updated on 11-Jul-2025 18:16:55

237 Views

The _Noreturn function specifier in C indicates to the compiler that the function will either exit or run in an infinite loop. This function never returns the control to the main function or wherever it was called in the program. If the _Noreturn function uses the return statement, the compiler will generate a warning or show an undefined behavior. Syntax of _Noreturn Function Specifier The syntax of _Noreturn function specifier is given below: _Noreturn data_type function_name() { --- code lines --- } _Noreturn with exit() Function in ... Read More

Adam Number in C++

Ravi Ranjan
Updated on 11-Jul-2025 18:16:36

2K+ Views

The Adam number is a number such that the square of the given number 'n' is the reverse of the square of the reverse of that number 'n'. In this article, our task is to write a program that can check whether the given number is an Adam number or not. Here is an example to check whether 12 is an Adam number or not: Input: num = 12 Output: 12 is an Adam number Explanation: num = 12 , square of num = ... Read More

When to use inline function and when not to use it in C/C++?

Tapas Kumar Ghosh
Updated on 11-Jul-2025 17:48:27

2K+ Views

In C/C++, an inline function is a function where the compiler replaces the function call with the actual code of the function during compilation. So, this makes the program run faster than a normal function call. Why to Use Inline Function in C/C++? We should use an inline function in C/C++ when the function is very simple and small size. Also, avoid the regular function call and replace macros with type safety. Let us understand how an inline function is used for small functions. Suppose we write square(5), the compiler converts it directly to 5*5. This makes the program run ... Read More

All pair combinations of 2 tuples in Python

Tapas Kumar Ghosh
Updated on 11-Jul-2025 17:41:57

295 Views

Python tuples are immutable sequences that used to store collections of items. When working with two tuples, you may sometimes need to generate all possible pairs, where each pair contains one element from the first tuple and one from the second. In this article, we will learn different ways to generate all pair combinations from two tuples Following are input-output scenarios for pairing combinations of two tuples: Input: first_tuple = (1, 3) second_tuple = (7, 9) Output: [(1, 7), (1, 9), (3, 7), (3, 9), (7, 1), (7, 3), (9, 1), (9, 3)] Explanation: At index 0 of first_tuple pairs ... Read More

Aligning table to X-axis using matplotlib Python

Tapas Kumar Ghosh
Updated on 11-Jul-2025 17:35:10

2K+ Views

The Python Matplotlib library allows us to create visual plots from given data. To make the data easier to read and relate to the chart, we can display it in the form of a table and position it directly below the corresponding bar chart. Since the x-axis runs horizontally, we arrange the table in the same direction so that each value aligns correctly under its corresponding bar. Based on this concept, we demonstrate the diagram as follows: Steps to Align a Table to the X-axis Using Matplotlib Following are the steps to create a table and store data ... Read More

Age Calculator using Python Tkinter

Tapas Kumar Ghosh
Updated on 11-Jul-2025 17:34:00

2K+ Views

An age calculator in Python using Tkinter is a GUI (Graphical User Interface) application that allows users to determine their age based on their date of birth (DOB). To design the user interface of this application, we use various methods provided by the Tkinter library such as Tk(), pack(), Entry(), Button(), and more. GUI of Age Calculator Let us build a GUI-based age calculator where the user can enter their age in the format of years, months, and days. Ensure that single-digit numbers are prefixed with a 0. Creating an Age Calculator Application using Python Tkinter To create an ... Read More

All possible concatenations in String List Using Python

Tapas Kumar Ghosh
Updated on 11-Jul-2025 15:18:56

2K+ Views

All possible concatenations in a string list means to generate every possible combination of strings by concatenating two or more elements from a given list of strings. In this article, we are given a string list and we need to find all its possible concatenations. Following are the input-output scenarios for concatenating string's list: Scenario 1 Input: X = ['TP', 'Tutorix'] Output: ['TP', 'Tutorix', 'TPTutorix', 'TutorixTP'] Explanation: When the list contains two strings, say 'TP' and 'Tutorix', it returns two more additional possibilities like 'TPTutorix' and 'TutorixTP'. Scenario 2 Input: X = ['AP', 'BQ', 'CR'] Output: ['AP', 'BQ', 'CR', ... Read More

Find maximum sum of triplets in an array such than i < j < k and a[i] < a[j] < a[k] in C++

Ravi Ranjan
Updated on 01-Jul-2025 15:35:10

2K+ Views

In this article, we have an array of positive integers of size n. Our task is to calculate the maximum sum of triplet ( ai + aj + ak ) such that 0 sum = 12 3 6 10 => sum = 19 3 4 10 => sum = 17 4 5 10 => sum = 19 2 5 10 => sum = 17 Maximum sum = 19 Finding maximum sum of triplets in an array such than i < j < k and a[i] < a[j] < a[k]Here are the approaches ... Read More

Advertisements